This commit was manufactured by cvs2svn to create tag 'milter-0_8_0'.
Sprout from bmsi 2005-05-31 18:23:49 UTC Stuart Gathman <stuart@gathman.org> 'Development changes since 0.7.2' Cherrypick from master 2005-06-06 18:24:59 UTC Stuart Gathman <stuart@gathman.org> 'Properly log exceptions from pydspam': COPYING MANIFEST.in Milter/__init__.py Milter/dsn.py Milter/dynip.py NEWS TODO bms.py milter.cfg milter.html milter.spec miltermodule.c mime.py setup.cfg setup.py softfail.txt spf.py spfquery.py strike3.txt test/zip1 testmime.py
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"""SPF (Sender-Permitted From) implementation.
|
||||
|
||||
Copyright (c) 2003, Terence Way
|
||||
Portions Copyright (c) 2004,2005 Stuart Gathman <stuart@bmsi.com>
|
||||
This module is free software, and you may redistribute it and/or modify
|
||||
it under the same terms as Python itself, so long as this copyright message
|
||||
and disclaimer are retained in their original form.
|
||||
@@ -45,6 +46,12 @@ For news, bugfixes, etc. visit the home page for this implementation at
|
||||
# Terrence is not responding to email.
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.3 2005/06/02 02:08:12 customdesigned
|
||||
# Reject on PermErr
|
||||
#
|
||||
# Revision 1.2 2005/05/31 18:57:59 customdesigned
|
||||
# Clear unknown mechanism list at proper time.
|
||||
#
|
||||
# Revision 1.24 2005/03/16 21:58:39 stuart
|
||||
# Change Milter module to package.
|
||||
#
|
||||
@@ -401,6 +408,7 @@ class query(object):
|
||||
Returns (result, mta-status-code, explanation) where
|
||||
result in ['fail', 'softfail', 'neutral' 'unknown', 'pass', 'error']
|
||||
"""
|
||||
self.mech = [] # unknown mechanisms
|
||||
if self.i.startswith('127.'):
|
||||
return ('pass', 250, 'local connections always pass')
|
||||
|
||||
@@ -416,11 +424,12 @@ class query(object):
|
||||
except TempError,x:
|
||||
return ('error', 450, 'SPF Temporary Error: ' + str(x))
|
||||
except PermError,x:
|
||||
# Pre-Lentczner draft treats this as an unknown result
|
||||
# and equivalent to no SPF record.
|
||||
self.prob = x.msg
|
||||
self.mech.append(x.mech)
|
||||
return ('unknown', 550, 'SPF Permanent Error: ' + str(x))
|
||||
self.prob = x.msg
|
||||
self.mech.append(x.mech)
|
||||
# Pre-Lentczner draft treats this as an unknown result
|
||||
# and equivalent to no SPF record.
|
||||
# return ('unknown', 550, 'SPF Permanent Error: ' + str(x))
|
||||
return ('error', 550, 'SPF Permanent Error: ' + str(x))
|
||||
|
||||
def check1(self, spf, domain, recursion):
|
||||
# spf rfc: 3.7 Processing Limits
|
||||
@@ -456,7 +465,6 @@ class query(object):
|
||||
# overridden with 'default=' modifier
|
||||
#
|
||||
default = 'neutral'
|
||||
self.mech = [] # unknown mechanisms
|
||||
|
||||
# Look for modifiers
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user