simplify some output in the work-in-progress mail log scanner

This commit is contained in:
Joshua Tauberer 2014-11-21 16:30:12 +00:00
parent 8ec8c42441
commit 82cf5b72e4
1 changed files with 15 additions and 0 deletions

View File

@ -96,6 +96,21 @@ def scan_postfix_smtpd_line(date, log, collector):
message, sender, recipient = m.groups() message, sender, recipient = m.groups()
if recipient in collector["real_mail_addresses"]: if recipient in collector["real_mail_addresses"]:
# only log mail to real recipients # only log mail to real recipients
# skip this, is reported in the greylisting report
if "Recipient address rejected: Greylisted" in message:
return
# simplify this one
m = re.search(r"Client host \[(.*?)\] blocked using zen.spamhaus.org; (.*)", message)
if m:
message = "ip blocked: " + m.group(2)
# simplify this one too
m = re.search(r"Sender address \[.*@(.*)\] blocked using dbl.spamhaus.org; (.*)", message)
if m:
message = "domain blocked: " + m.group(2)
collector["rejected-mail"].setdefault(recipient, []).append( (date, sender, message) ) collector["rejected-mail"].setdefault(recipient, []).append( (date, sender, message) )