summaryrefslogtreecommitdiff
path: root/Mailman/Bouncers/BouncerAPI.py
diff options
context:
space:
mode:
authorbwarsaw2000-06-05 15:54:47 +0000
committerbwarsaw2000-06-05 15:54:47 +0000
commitc2c6f9c24c7ea40a4a3eddf263093e586ae838ed (patch)
tree842ff30c70e5b7d67582bd46f45071e0650c736a /Mailman/Bouncers/BouncerAPI.py
parentfb469cad2ba6040d9c942eeb62ba769ce365d585 (diff)
downloadmailman-c2c6f9c24c7ea40a4a3eddf263093e586ae838ed.tar.gz
mailman-c2c6f9c24c7ea40a4a3eddf263093e586ae838ed.tar.zst
mailman-c2c6f9c24c7ea40a4a3eddf263093e586ae838ed.zip
Diffstat (limited to 'Mailman/Bouncers/BouncerAPI.py')
-rw-r--r--Mailman/Bouncers/BouncerAPI.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/Mailman/Bouncers/BouncerAPI.py b/Mailman/Bouncers/BouncerAPI.py
index 340cc896e..0415df9a4 100644
--- a/Mailman/Bouncers/BouncerAPI.py
+++ b/Mailman/Bouncers/BouncerAPI.py
@@ -41,22 +41,24 @@ def ScanMessages(mlist, msg, testing=0):
'Caiwireless',
'Smail',
'Exim',
+ 'Netscape',
'Catchall',
]
for modname in pipeline:
mod = __import__('Mailman.Bouncers.'+modname)
func = getattr(getattr(getattr(mod, 'Bouncers'), modname), 'process')
- addrs = func(mlist, msg)
+ addrs = func(msg)
if addrs:
for addr in addrs:
# we found a bounce or a list of bounce addrs
if not testing:
mlist.RegisterBounce(addr, msg)
else:
- print ' Bounce of %s detected by module %s' % (
- addr, modname)
+ print '%16s: detected address <%s>' % (modname, addr)
# we saw some bounces
return 1
+ elif testing:
+ print '%16s: no bounces detected' % modname
# no bounces detected
return 0
@@ -73,15 +75,12 @@ if __name__ == '__main__':
print msg
sys.exit(code)
- if len(sys.argv) < 3:
- usage(1, 'required arguments: <list> <file> [, <file> ...]')
+ if len(sys.argv) < 2:
+ usage(1, 'required arguments: <file> [, <file> ...]')
- listname = sys.argv[1]
- mlist = MailList.MailList(listname, lock=0)
-
- for filename in sys.argv[2:]:
+ for filename in sys.argv[1:]:
print 'scanning file', filename
fp = open(filename)
msg = mimetools.Message(fp)
- ScanMessages(mlist, msg, testing=1)
+ ScanMessages(None, msg, testing=1)
fp.close()