Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Mailman/Archiver/HyperArch.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def decode_headers(self):
i18n.set_language(self._lang)
atmark = _(' at ')
subject = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
'\g<1>' + atmark + '\g<2>', subject)
r'\g<1>' + atmark + r'\g<2>', subject)
finally:
i18n.set_translation(otrans)
self.decoded['subject'] = subject
Expand Down Expand Up @@ -589,7 +589,7 @@ def as_text(self):
if isinstance(atmark, bytes):
atmark = str(atmark, cset)
body = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
'\g<1>' + atmark + '\g<2>', body)
r'\g<1>' + atmark + r'\g<2>', body)
finally:
i18n.set_translation(otrans)

Expand Down
86 changes: 43 additions & 43 deletions Mailman/Bouncers/SimpleMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,152 +49,152 @@ def _c(pattern):
# robanal.demon.co.uk
(_c('this message was created automatically by mail delivery software'),
_c('original message follows'),
_c('rcpt to:\s*<(?P<addr>[^>]*)>')),
_c(r'rcpt to:\s*<(?P<addr>[^>]*)>')),
# s1.com (InterScan E-Mail VirusWall NT ???)
(_c('message from interscan e-mail viruswall nt'),
_c('end of message'),
_c('rcpt to:\s*<(?P<addr>[^>]*)>')),
_c(r'rcpt to:\s*<(?P<addr>[^>]*)>')),
# Smail
(_c('failed addresses follow:'),
_c('message text follows:'),
_c(r'\s*(?P<addr>\S+@\S+)')),
# newmail.ru
(_c('This is the machine generated message from mail service.'),
_c('--- Below the next line is a copy of the message.'),
_c('<(?P<addr>[^>]*)>')),
_c(r'<(?P<addr>[^>]*)>')),
# turbosport.com runs something called `MDaemon 3.5.2' ???
(_c('The following addresses did NOT receive a copy of your message:'),
_c('--- Session Transcript ---'),
_c('[>]\s*(?P<addr>.*)$')),
_c(r'[>]\s*(?P<addr>.*)$')),
# usa.net
(_c('Intended recipient:\s*(?P<addr>.*)$'),
(_c(r'Intended recipient:\s*(?P<addr>.*)$'),
_c('--------RETURNED MAIL FOLLOWS--------'),
_c('Intended recipient:\s*(?P<addr>.*)$')),
_c(r'Intended recipient:\s*(?P<addr>.*)$')),
# hotpop.com
(_c('Undeliverable Address:\s*(?P<addr>.*)$'),
(_c(r'Undeliverable Address:\s*(?P<addr>.*)$'),
_c('Original message attached'),
_c('Undeliverable Address:\s*(?P<addr>.*)$')),
_c(r'Undeliverable Address:\s*(?P<addr>.*)$')),
# Another demon.co.uk format
(_c('This message was created automatically by mail delivery'),
_c('^---- START OF RETURNED MESSAGE ----'),
_c("addressed to '(?P<addr>[^']*)'")),
_c(r"addressed to '(?P<addr>[^']*)'")),
# Prodigy.net full mailbox
(_c("User's mailbox is full:"),
_c('Unable to deliver mail.'),
_c("User's mailbox is full:\s*<(?P<addr>[^>]*)>")),
_c(r"User's mailbox is full:\s*<(?P<addr>[^>]*)>")),
# Microsoft SMTPSVC
(_c('The email below could not be delivered to the following user:'),
_c('Old message:'),
_c('<(?P<addr>[^>]*)>')),
_c(r'<(?P<addr>[^>]*)>')),
# Yahoo on behalf of other domains like sbcglobal.net
(_c('Unable to deliver message to the following address\(es\)\.'),
_c('--- Original message follows\.'),
_c('<(?P<addr>[^>]*)>:')),
(_c(r'Unable to deliver message to the following address\(es\)\.'),
_c(r'--- Original message follows\.'),
_c(r'<(?P<addr>[^>]*)>:')),
# googlemail.com
(_c('Delivery to the following recipient(s)? failed'),
_c('----- Original message -----'),
_c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# kundenserver.de, mxlogic.net
(_c('A message that you( have)? sent could not be delivered'),
_c('^---'),
_c('<(?P<addr>[^>]*)>')),
_c(r'<(?P<addr>[^>]*)>')),
# another kundenserver.de
(_c('A message that you( have)? sent could not be delivered'),
_c('^---'),
_c('^(?P<addr>[^\s@]+@[^\s@:]+):')),
_c(r'^(?P<addr>[^\s@]+@[^\s@:]+):')),
# thehartford.com and amenworld.com
(_c('Del(i|e)very to the following recipient(s)? (failed|was aborted)'),
# this one may or may not have the original message, but there's nothing
# unique to stop on, so stop on the first line of at least 3 characters
# that doesn't start with 'D' (to not stop immediately) and has no '@'.
_c('^[^D][^@]{2,}$'),
_c('^\s*(. )?(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^[^D][^@]{2,}$'),
_c(r'^\s*(. )?(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# and another thehartfod.com/hartfordlife.com
(_c('^Your message\s*$'),
(_c(r'^Your message\s*$'),
_c('^because:'),
_c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# kviv.be (InterScan NT)
(_c('^Unable to deliver message to'),
_c(r'\*+\s+End of message\s+\*+'),
_c('<(?P<addr>[^>]*)>')),
_c(r'<(?P<addr>[^>]*)>')),
# earthlink.net supported domains
(_c('^Sorry, unable to deliver your message to'),
_c('^A copy of the original message'),
_c('\s*(?P<addr>[^\s@]+@[^\s@]+)\s+')),
_c(r'\s*(?P<addr>[^\s@]+@[^\s@]+)\s+')),
# ademe.fr
(_c('^A message could not be delivered to:'),
_c('^Subject:'),
_c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# andrew.ac.jp
(_c('^Invalid final delivery userid:'),
_c('^Original message follows.'),
_c('\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# E500_SMTP_Mail_Service@lerctr.org and similar
(_c('---- Failed Recipients ----'),
_c(' Mail ----'),
_c('<(?P<addr>[^>]*)>')),
# cynergycom.net
(_c('A message that you sent could not be delivered'),
_c('^---'),
_c('(?P<addr>[^\s@]+@[^\s@)]+)')),
_c(r'(?P<addr>[^\s@]+@[^\s@)]+)')),
# LSMTP for Windows
(_c('^--> Error description:\s*$'),
(_c(r'^--> Error description:\s*$'),
_c('^Error-End:'),
_c('^Error-for:\s+(?P<addr>[^\s@]+@[^\s@]+)')),
_c(r'^Error-for:\s+(?P<addr>[^\s@]+@[^\s@]+)')),
# Qmail with a tri-language intro beginning in spanish
(_c('Your message could not be delivered'),
_c('^-'),
_c('<(?P<addr>[^>]*)>:')),
# socgen.com
(_c('Your message could not be delivered to'),
_c('^\s*$'),
_c('(?P<addr>[^\s@]+@[^\s@]+)')),
_c(r'^\s*$'),
_c(r'(?P<addr>[^\s@]+@[^\s@]+)')),
# dadoservice.it
(_c('Your message has encountered delivery problems'),
_c('Your message reads'),
_c('addressed to\s*(?P<addr>[^\s@]+@[^\s@)]+)')),
_c(r'addressed to\s*(?P<addr>[^\s@]+@[^\s@)]+)')),
# gomaps.com
(_c('Did not reach the following recipient'),
_c('^\s*$'),
_c('\s(?P<addr>[^\s@]+@[^\s@]+)')),
_c(r'^\s*$'),
_c(r'\s(?P<addr>[^\s@]+@[^\s@]+)')),
# EYOU MTA SYSTEM
(_c('This is the deliver program at'),
_c('^-'),
_c('^(?P<addr>[^\s@]+@[^\s@<>]+)')),
_c(r'^(?P<addr>[^\s@]+@[^\s@<>]+)')),
# A non-standard qmail at ieo.it
(_c('this is the email server at'),
_c('^-'),
_c('\s(?P<addr>[^\s@]+@[^\s@]+)[\s,]')),
_c(r'\s(?P<addr>[^\s@]+@[^\s@]+)[\s,]')),
# pla.net.py (MDaemon.PRO ?)
(_c('- no such user here'),
_c('There is no user'),
_c('^(?P<addr>[^\s@]+@[^\s@]+)\s')),
_c(r'^(?P<addr>[^\s@]+@[^\s@]+)\s')),
# fastdnsservers.com
(_c('The following recipient.*could not be reached'),
_c('bogus stop pattern'),
_c('^(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# lttf.com
(_c('Could not deliver message to'),
_c('^\s*--'),
_c('^Failed Recipient:\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^\s*--'),
_c(r'^Failed Recipient:\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# uci.edu
(_c('--------Message not delivered'),
_c('--------Error Detail'),
_c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
_c(r'^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')),
# Dovecot LDA Over quota MDN (bogus - should be DSN).
(_c('^Your message'),
_c('^Reporting'),
_c(
'Your message to (?P<addr>[^\s@]+@[^\s@]+) was automatically rejected'
r'Your message to (?P<addr>[^\s@]+@[^\s@]+) was automatically rejected'
)),
# mail.ru
(_c('A message that you sent was rejected'),
_c('This is a copy of your message'),
_c('\s(?P<addr>[^\s@]+@[^\s@]+)')),
_c(r'\s(?P<addr>[^\s@]+@[^\s@]+)')),
# MailEnable
(_c('Message could not be delivered to some recipients.'),
_c('Message headers follow'),
_c('Recipient: \[SMTP:(?P<addr>[^\s@]+@[^\s@]+)\]')),
_c(r'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.'),
Expand Down
4 changes: 2 additions & 2 deletions Mailman/Handlers/CookHeaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def process(mlist, msg, msgdata):
uvia = str(via, lcs, errors='replace')

# Replace the dummy replacements.
uvia = re.sub(u'%\(lrn\)s', ulrn, re.sub(u'%\(realname\)s', urn, uvia))
uvia = re.sub(r'%\(lrn\)s', ulrn, re.sub(r'%\(realname\)s', urn, uvia))
# And get an RFC 2047 encoded header string.
dn = str(Header(uvia, lcs))
change_header('From',
Expand Down Expand Up @@ -424,7 +424,7 @@ def prefix_subject(mlist, msg, msgdata):
# leading space after stripping the prefix. It is not known what MUA would
# create such a Subject:, but the issue was reported.
rematch = re.match(
'(\s*(RE|AW|SV|VS)\s*(\[\d+\])?\s*:\s*)+',
r'(\s*(RE|AW|SV|VS)\s*(\[\d+\])?\s*:\s*)+',
subject, re.I)
if rematch:
subject = subject[rematch.end():]
Expand Down
2 changes: 1 addition & 1 deletion Mailman/Handlers/SpamDetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def getDecodedHeaders(msg, cset='utf-8'):
uvalue = u''
try:
if isinstance(v, str):
v = decode_header(re.sub('\n\s', ' ', v))
v = decode_header(re.sub(r'\n\s', ' ', v))
else:
continue
except HeaderParseError:
Expand Down
2 changes: 1 addition & 1 deletion Mailman/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ def check_eq_domains(email, domains_list):
except ValueError:
return []
domain = domain.lower()
domains_list = re.sub('\s', '', domains_list).lower()
domains_list = re.sub(r'\s', '', domains_list).lower()
domains = domains_list.split(';')
domains_list = []
for d in domains:
Expand Down
2 changes: 1 addition & 1 deletion bin/newlist
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def main():

# And send the notice to the list owner
if not quiet and not automate:
print('Hit enter to notify %(listname)s owner...'),
print(C_('Hit enter to notify %(listname)s owner...')),
sys.stdin.readline()
if not quiet:
siteowner = Utils.get_site_email(mlist.host_name, 'owner')
Expand Down