diff options
author | Yasuhito FUTATSUKI <futatuki@poem.co.jp> | 2020-06-01 15:50:14 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI <futatuki@poem.co.jp> | 2020-06-01 15:50:14 +0900 |
commit | 6a23f43f94e1cbfbbd413d83f713584815938178 (patch) | |
tree | f0f2fb5fcb4fbb121915eddb949f7536bc22d037 /Mailman/Bouncers/SimpleMatch.py | |
parent | e2bfc83935b64208b56194d82d04c61c25f8406d (diff) | |
parent | bc7fdf4c5fb688ae62e48e614bc285bdcd805ffc (diff) | |
download | mailman2-6a23f43f94e1cbfbbd413d83f713584815938178.tar.gz mailman2-6a23f43f94e1cbfbbd413d83f713584815938178.tar.xz mailman2-6a23f43f94e1cbfbbd413d83f713584815938178.zip |
sync with lp:mailman/2.1 (just same)
Diffstat (limited to '')
-rw-r--r-- | Mailman/Bouncers/SimpleMatch.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Mailman/Bouncers/SimpleMatch.py b/Mailman/Bouncers/SimpleMatch.py index ca648f65..6de9a858 100644 --- a/Mailman/Bouncers/SimpleMatch.py +++ b/Mailman/Bouncers/SimpleMatch.py @@ -25,6 +25,9 @@ import email.Iterators def _c(pattern): return re.compile(pattern, re.IGNORECASE) +# Pattern to match any valid email address and not much more. +VALID = _c(r'^[\x21-\x3d\x3f\x41-\x7e]+@[a-z0-9._]+$') + # This is a list of tuples of the form # # (start cre, end cre, address cre) @@ -192,6 +195,10 @@ PATTERNS = [ (_c('Message could not be delivered to some recipients.'), _c('Message headers follow'), _c('Recipient: \[SMTP:(?P<addr>[^\s@]+@[^\s@]+)\]')), + # This one is from Yahoo but dosen't fit the yahoo recognizer format + (_c(r'wasn\'t able to deliver the following message'), + _c(r'---Below this line is a copy of the message.'), + _c(r'To: (?P<addr>[^\s@]+@[^\s@]+)')), # Next one goes here... ] @@ -227,4 +234,4 @@ def process(msg, patterns=None): break if addrs: break - return addrs.keys() + return [x for x in addrs.keys() if VALID.match(x)] |