Handle missing gossip_node so self tests pass.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
# A simple milter that has grown quite a bit.
|
||||
# $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
|
||||
# CBV policy sends no DSN. DSN policy sends DSN.
|
||||
#
|
||||
@@ -210,6 +213,7 @@ try:
|
||||
import gossip
|
||||
import gossip.client
|
||||
import gossip.server
|
||||
gossip_node = None
|
||||
except: gossip = None
|
||||
|
||||
# Import pysrs if available
|
||||
@@ -893,7 +897,8 @@ class bmsMilter(Milter.Milter):
|
||||
else:
|
||||
global gossip
|
||||
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':
|
||||
qual = 'SPF'
|
||||
elif res == 'pass':
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%changelog
|
||||
* Mon Sep 24 2007 Stuart Gathman <stuart@bmsi.com> 0.8.10-1
|
||||
- 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
|
||||
- check for porn words in MAIL FROM fullname
|
||||
- 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.headerschanged = True
|
||||
|
||||
def addheader(self,field,value):
|
||||
def addheader(self,field,value,idx=-1):
|
||||
if not self._body:
|
||||
raise IOError,"addheader not called from eom()"
|
||||
self.log('addheader: %s=%s' % (field,value))
|
||||
|
||||
Reference in New Issue
Block a user