diff options
| author | cotton | 1998-10-01 15:51:49 +0000 |
|---|---|---|
| committer | cotton | 1998-10-01 15:51:49 +0000 |
| commit | 1819c802f103a0178d00bc7b18be76da15738215 (patch) | |
| tree | b5a14ea76889a731f73ee1039834df67f0718b1f /Mailman/Message.py | |
| parent | 25cf5dc3beba9437557399efcb4e52b04d514143 (diff) | |
| download | mailman-1819c802f103a0178d00bc7b18be76da15738215.tar.gz mailman-1819c802f103a0178d00bc7b18be76da15738215.tar.zst mailman-1819c802f103a0178d00bc7b18be76da15738215.zip | |
Diffstat (limited to 'Mailman/Message.py')
| -rw-r--r-- | Mailman/Message.py | 25 |
1 files changed, 25 insertions, 0 deletions
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 <listname>-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: |
