h = Utils.oneline(s, 'iso-8859-1')
else:
h = s
- h = str('').join(re.split('[\x00-\x09\x0B-\x1f]+', h))
+ h = str('').join(re.split('[\x00-\x08\x0B-\x1f]+', h))
return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<'))
def to_forlife(email):
mlist.Unlock()
if raw:
- return str(msg)
+ return quote(str(msg))
results_plain = []
results_html = []
for part in typed_subpart_iterator(msg, 'text', 'plain'):
return 0
if mlist.header_filter_rules == []:
return 0
- action = mlist.header_filter_rules[0][1]
- if action == mm_cfg.HOLD:
- return 1
- if action == mm_cfg.DISCARD:
+ try:
+ action = mlist.header_filter_rules[1][1]
return 2
+ except:
+ action = mlist.header_filter_rules[0][1]
+ if action == mm_cfg.HOLD:
+ return 1
+ if action == mm_cfg.DISCARD:
+ return 3
except:
return 0
if int(level) is 1:
hfr.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False))
elif int(level) is 2:
+ hfr.append(('X-Spam-Flag: Yes, tests=bogofilter, spamicity=(0\.999999|1\.000000)', mm_cfg.DISCARD, False))
+ hfr.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False))
+ elif int(level) is 3:
hfr.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.DISCARD, False))
if mlist.header_filter_rules != hfr:
mlist.Lock()
}
def check_options(userdesc, perms, vhost, listname, correct=False):
+ listname = listname.lower()
try:
- mlist = MailList.MailList(vhost+VHOST_SEP+listname.lower(), lock=0)
+ mlist = MailList.MailList(vhost+VHOST_SEP+listname, lock=0)
except:
return 0
try: