summaryrefslogtreecommitdiff
path: root/Mailman/Deliverer.py
diff options
context:
space:
mode:
authorcotton1998-10-01 15:51:49 +0000
committercotton1998-10-01 15:51:49 +0000
commit1819c802f103a0178d00bc7b18be76da15738215 (patch)
treeb5a14ea76889a731f73ee1039834df67f0718b1f /Mailman/Deliverer.py
parent25cf5dc3beba9437557399efcb4e52b04d514143 (diff)
downloadmailman-1819c802f103a0178d00bc7b18be76da15738215.tar.gz
mailman-1819c802f103a0178d00bc7b18be76da15738215.tar.zst
mailman-1819c802f103a0178d00bc7b18be76da15738215.zip
Diffstat (limited to 'Mailman/Deliverer.py')
-rw-r--r--Mailman/Deliverer.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/Mailman/Deliverer.py b/Mailman/Deliverer.py
index a34a0810b..fc55c1aca 100644
--- a/Mailman/Deliverer.py
+++ b/Mailman/Deliverer.py
@@ -45,6 +45,42 @@ class Deliverer:
def QuotePeriods(self, text):
return string.join(string.split(text, '\n.\n'), '\n .\n')
+
+ #
+ # this function is used to deliver messages
+ # that are sent to <listname>-admin. the sender
+ # is the envelope sender of the message, or if
+ # that is not available, the sender via Message.GetSender()
+ # the recipients arg is a list of the current list
+ # owners. We don't mess with adding list specific
+ # headers on body modifications so that the address
+ # will work just like a normal forwarding address
+ #
+ def DeliverToOwner(self, msg, recipients):
+ if not (len(recipients)):
+ return
+ sender = msg.GetEnvelopeSender()
+ if not sender:
+ sender = msg.GetSender()
+ cmd = "%s %s" % (mm_cfg.PYTHON,
+ os.path.join(mm_cfg.SCRIPTS_DIR, "deliver"))
+ cmdproc = os.popen(cmd, 'w')
+
+ cmdproc.write("%d\n" % self.num_spawns)
+ cmdproc.write("%s\n" % sender)
+ for r in recipients:
+ # Mustn't send blank lines before end of recipients:
+ if not r: continue
+ cmdproc.write(r + "\n")
+ cmdproc.write('\n')
+ cmdproc.write(string.join(msg.headers, '') + "\n")
+ cmdproc.write(self.QuotePeriods(msg.body))
+ status = cmdproc.close()
+ if status:
+ sys.stderr.write('Non-zero exit status: %d'
+ '\nCommand: %s' % ((status >> 8), cmd))
+
+
def DeliverToList(self, msg, recipients,
header="", footer="", remove_to=0, tmpfile_prefix = ""):
if not(len(recipients)):