提交 6f4cbaed 编写于 作者: J Joerg Jaspert

whitelist patch

this needs module re for now
Signed-off-by: NJoerg Jaspert <joerg@debian.org>
上级 15194858
......@@ -105,4 +105,5 @@ re_gpg_fingerprint = re.compile(r"^fpr:+(.*):$", re.MULTILINE);
re_user_address = re.compile(r"^pub:.*<(.*)@.*>.*$", re.MULTILINE);
re_user_mails = re.compile(r"^(pub|uid):[^rdin].*<(.*@.*)>.*$", re.MULTILINE);
re_user_name = re.compile(r"^pub:.*:(.*)<.*$", re.MULTILINE);
re_re_mark = re.compile(r'^RE:')
......@@ -37,11 +37,12 @@ import stat
import apt_pkg
import database
import time
import re
import email as modemail
from dak_exceptions import *
from regexes import re_html_escaping, html_escaping, re_single_line_field, \
re_multi_line_field, re_srchasver, re_verwithext, \
re_parse_maintainer, re_taint_free, re_gpg_uid
re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark
################################################################################
......@@ -607,11 +608,10 @@ def send_mail (message, filename=""):
whitelist = [];
whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"])
RE_mark = re.compile(r'^RE:')
try:
for line in whitelist_in:
if RE_mark.match(line):
whitelist.append(re.compile(RE_mark.sub("", line.strip(), 1)))
if re_re_mark.match(line):
whitelist.append(re.compile(re_re_mark.sub("", line.strip(), 1)))
else:
whitelist.append(re.compile(re.escape(line.strip())))
finally:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册