From 1819c802f103a0178d00bc7b18be76da15738215 Mon Sep 17 00:00:00 2001 From: cotton Date: Thu, 1 Oct 1998 15:51:49 +0000 Subject: Added DeliverToOwner to Deliverer class in Deliverer.py that passes a message to the -admin address to the owners untouched and with the sender of the original message Added a GetEnvelopeSender method to Message.py that attempts to find the envelope sender from a messages's unix from line for use by DeliverToOwner changed the mailowner script to use DeliverToOwner method instead of the DeliverToList method scott --- Mailman/Message.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Mailman/Message.py') diff --git a/Mailman/Message.py b/Mailman/Message.py index 45c355c9d..83d3d3b6f 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -112,6 +112,31 @@ class IncomingMessage(rfc822.Message): return string.lower(mail_address) + def GetEnvelopeSender(self): + # + # look for unix from line and attain address + # from it, return None if there is no unix from line + # this function is used to get the envelope sender + # when mail is sent to a -admin address + # + if not self.unixfrom: + return None + parts = string.split(self.unixfrom) # XXX assumes no whitespace in address + for part in parts: + # + # perform minimal check for the address + # + if string.find(part, '@') > -1: + user, host = string.split(part, '@', 1) + if not user: + continue + if string.count(host, ".") < 1: # doesn't look qualified + continue + return part + return None + + + def GetSenderName(self): real_name, mail_addr = self.getaddr('from') if not real_name: -- cgit v1.2.3-70-g09d2