diff options
author | <> | 2003-01-02 05:25:50 +0000 |
---|---|---|
committer | <> | 2003-01-02 05:25:50 +0000 |
commit | b132a73f15e432eaf43310fce9196ca0c0651465 (patch) | |
tree | c15f816ba7c4de99fef510e3bd75af0890d47441 /tests/fblast.py | |
download | mailman2-b132a73f15e432eaf43310fce9196ca0c0651465.tar.gz mailman2-b132a73f15e432eaf43310fce9196ca0c0651465.tar.xz mailman2-b132a73f15e432eaf43310fce9196ca0c0651465.zip |
This commit was manufactured by cvs2svn to create branch
'Release_2_1-maint'.
Diffstat (limited to 'tests/fblast.py')
-rw-r--r-- | tests/fblast.py | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/fblast.py b/tests/fblast.py new file mode 100644 index 00000000..2add9458 --- /dev/null +++ b/tests/fblast.py @@ -0,0 +1,60 @@ +"""Throw email at Mailman as fast as you can. + +This is not a unit test, it's a functional test, so you can't run it within +the unit test framework (hence its filename doesn't start with `test_'). +Here's how I use this one: + +- set up a dummy list + +- add an alias to your MTA, say `devnull' that pipes its messages to, you + guessed it, /dev/null + +- make this address a member of your list + +- add another address to `accept_these_non_members', let's call it ok@dom.ain + +- change the FROMADDR variable to ok@dom.ain + +- change the LISTADDR variable to point to your list + +- run this program like so: python fblast.py N + where N is the number of seconds to sleep before sending the next msg + +- let this run until you're tired of it, then hit ^C +""" + +FROMADDR = 'ok@dom.ain' +LISTADDR = 'list@dom.ain' + +import sys +import time +import smtplib + +conn = smtplib.SMTP() +conn.connect() + +snooze = int(sys.argv[1]) + +try: + i = 1 + while 1: + sys.stdout.write('.') + sys.stdout.flush() + i += 1 + if i % 50 == 0: + print + for j in range(10): + conn.sendmail(FROMADDR, [LISTADDR], """\ +From: %(FROMADDR)s +To: $(LISTADDR)s +Subject: test %(num)d +X-No-Archive: yes + +testing %(num)d +""" % {'num' : i, + 'FROMADDR': FROMADDR, + 'LISTADDR': LISTADDR, + } + time.sleep(snooze) +finally: + conn.quit() |