Handle missing gossip_node so self tests pass.
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# A simple milter that has grown quite a bit.
|
# A simple milter that has grown quite a bit.
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.126 2008/08/18 17:47:57 customdesigned
|
||||||
|
# Log rcpt for SRS rejections.
|
||||||
|
#
|
||||||
# Revision 1.125 2008/08/06 00:52:38 customdesigned
|
# Revision 1.125 2008/08/06 00:52:38 customdesigned
|
||||||
# CBV policy sends no DSN. DSN policy sends DSN.
|
# CBV policy sends no DSN. DSN policy sends DSN.
|
||||||
#
|
#
|
||||||
@@ -210,6 +213,7 @@ try:
|
|||||||
import gossip
|
import gossip
|
||||||
import gossip.client
|
import gossip.client
|
||||||
import gossip.server
|
import gossip.server
|
||||||
|
gossip_node = None
|
||||||
except: gossip = None
|
except: gossip = None
|
||||||
|
|
||||||
# Import pysrs if available
|
# Import pysrs if available
|
||||||
@@ -893,7 +897,8 @@ class bmsMilter(Milter.Milter):
|
|||||||
else:
|
else:
|
||||||
global gossip
|
global gossip
|
||||||
if gossip and domain and rc == Milter.CONTINUE \
|
if gossip and domain and rc == Milter.CONTINUE \
|
||||||
and not (self.internal_connection or self.trusted_relay):
|
and not (self.internal_connection or self.trusted_relay) \
|
||||||
|
and gossip_node:
|
||||||
if self.spf and self.spf.result == 'pass':
|
if self.spf and self.spf.result == 'pass':
|
||||||
qual = 'SPF'
|
qual = 'SPF'
|
||||||
elif res == 'pass':
|
elif res == 'pass':
|
||||||
|
|||||||
+1
-1
@@ -276,7 +276,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%changelog
|
%changelog
|
||||||
* Mon Sep 24 2007 Stuart Gathman <stuart@bmsi.com> 0.8.10-1
|
* Mon Sep 24 2007 Stuart Gathman <stuart@bmsi.com> 0.8.10-1
|
||||||
- log rcpt for SRS rejections
|
- log rcpt for SRS rejections
|
||||||
- improved parsing into email and fullname
|
- improved parsing into email and fullname (still 2 self test failures)
|
||||||
- implement no-DSN CBV, reduce full DSNs
|
- implement no-DSN CBV, reduce full DSNs
|
||||||
- check for porn words in MAIL FROM fullname
|
- check for porn words in MAIL FROM fullname
|
||||||
- ban IP for too many bad MAIL FROMs or RCPT TOs
|
- ban IP for too many bad MAIL FROMs or RCPT TOs
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ class TestMilter(bms.bmsMilter):
|
|||||||
self._msg[field] = value
|
self._msg[field] = value
|
||||||
self.headerschanged = True
|
self.headerschanged = True
|
||||||
|
|
||||||
def addheader(self,field,value):
|
def addheader(self,field,value,idx=-1):
|
||||||
if not self._body:
|
if not self._body:
|
||||||
raise IOError,"addheader not called from eom()"
|
raise IOError,"addheader not called from eom()"
|
||||||
self.log('addheader: %s=%s' % (field,value))
|
self.log('addheader: %s=%s' % (field,value))
|
||||||
|
|||||||
Reference in New Issue
Block a user