diff options
| author | bwarsaw | 1999-01-12 22:29:13 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-01-12 22:29:13 +0000 |
| commit | 793e2b84ab4df875d5e34d621c13193e6b4bdb78 (patch) | |
| tree | 6366ca64746fc319ce4b4057a9783bed96292b53 /Mailman/pythonlib/rfc822.py | |
| parent | 61279875b4fc882415ec413f71e1e784b82ffd26 (diff) | |
| download | mailman-793e2b84ab4df875d5e34d621c13193e6b4bdb78.tar.gz mailman-793e2b84ab4df875d5e34d621c13193e6b4bdb78.tar.zst mailman-793e2b84ab4df875d5e34d621c13193e6b4bdb78.zip | |
Diffstat (limited to 'Mailman/pythonlib/rfc822.py')
| -rw-r--r-- | Mailman/pythonlib/rfc822.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Mailman/pythonlib/rfc822.py b/Mailman/pythonlib/rfc822.py index d8de862cf..7ce3ff254 100644 --- a/Mailman/pythonlib/rfc822.py +++ b/Mailman/pythonlib/rfc822.py @@ -310,6 +310,22 @@ class Message: a = AddrlistClass(data) return a.getaddrlist() + def getallrecipients(self): + """Returns a list of the all the recipient addresses. + + This list is of 2-tuple elements as returned by getaddr(), but is a + collation of all the To: and Cc: headers found in the message. + """ + rawrecips = [] + for h in (self.getallmatchingheaders('to') + + self.getallmatchingheaders('cc')): + i = string.find(h, ':') + if i > 0: + rawrecips.append(string.strip(h[i+1:])) + alladdrs = string.join(rawrecips, ', ') + a = AddressList(alladdrs) + return a.addresslist + def getdate(self, name): """Retrieve a date field from a header. |
