Properly log From: and Sender:

This commit is contained in:
Stuart Gathman
2007-03-21 04:02:13 +00:00
parent 188e8256f3
commit cee38f8149
3 changed files with 14 additions and 4 deletions
+3
View File
@@ -1,3 +1,6 @@
Add signature (x-sig=AB7485f=TS) to Received-SPF, so it can be used
to blacklist sources of delayed DSNs.
rcpt-addr may let us know when a recipient is unknown. That should count
against reputation.
+7 -2
View File
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# A simple milter that has grown quite a bit.
# $Log$
# Revision 1.97 2007/03/18 02:32:21 customdesigned
# Gossip configuration options: client or standalone with optional peers.
#
# Revision 1.96 2007/03/17 21:22:48 customdesigned
# New delayed DSN pattern. Retab (expandtab).
#
@@ -967,6 +970,8 @@ class bmsMilter(Milter.Milter):
userl = user.lower()
if users and not newaddr and not userl in users:
self.log('REJECT: RCPT TO:',to)
if gossip and self.umis:
gossip_node.feedback(self.umis,1)
return Milter.REJECT
# FIXME: should dspam_exempt be case insensitive?
if user in block_forward.get(domain,()):
@@ -1154,11 +1159,11 @@ class bmsMilter(Milter.Milter):
if hd == mf_domain or mf_domain.endswith('.'+hd): break
else:
for f in msg.get_all('from',[]):
self.log(f)
self.log('From:',f)
sender = msg.get_all('sender')
if sender:
for f in sender:
self.log(f)
self.log('Sender:',f)
else:
self.log("NOTE: Supplying MFROM as Sender");
self.add_header('Sender',self.mailfrom)
+4 -2
View File
@@ -24,11 +24,13 @@ exists by sending you this DSN. We will remember this sender and not
bother you again for a while. You can avoid this message entirely for
legitimate mail by using an authorized SMTP server. Contact your mail
administrator and ask how to configure your email client to use an
authorized server.
authorized server.
If you never sent the above message, then your domain has been forged.
Your mail admin needs to publish a strict SPF record so that I can reject
those forgeries instead of bugging you about them.
those forgeries instead of bugging you about them.
See http://openspf.org for details.
If you need further assistance, please do not hesitate to contact me.