提交 8429e764 编写于 作者: J Joerg Jaspert

mailwhitelist

ignore whitespace/comment lines.
Signed-off-by: NJoerg Jaspert <joerg@debian.org>
上级 5f8c2789
......@@ -35,6 +35,7 @@ re_fdnic = re.compile(r"\n\n")
re_bin_only_nmu = re.compile(r"\+b\d+$")
re_comments = re.compile(r"\#.*")
re_whitespace_comment = re.compile(r"^\s*(#|$)")
re_no_epoch = re.compile(r"^\d+\:")
re_no_revision = re.compile(r"-[^-]+$")
re_arch_from_filename = re.compile(r"/binary-[^/]+/")
......
......@@ -43,7 +43,8 @@ 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_re_mark
re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark, \
re_whitespace_comment
################################################################################
......@@ -616,10 +617,11 @@ def send_mail (message, filename=""):
whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"])
try:
for line in whitelist_in:
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())))
if not re_whitespace_comment.match(line):
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:
whitelist_in.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册