diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-03-01 22:42:28 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-03-01 22:42:28 +0000 |
commit | 68e603ca50c38d188d21854468332aa73b286ea3 (patch) | |
tree | 48bf064dc23f37f7eb2b2bbe4a06f559a3493db5 | |
parent | 47f54c3820f78d1b74823a40fbeb05d1064a4615 (diff) | |
download | fetchmail-68e603ca50c38d188d21854468332aa73b286ea3.tar.gz fetchmail-68e603ca50c38d188d21854468332aa73b286ea3.tar.bz2 fetchmail-68e603ca50c38d188d21854468332aa73b286ea3.zip |
Better test mail fetching.
svn path=/trunk/; revision=3170
-rwxr-xr-x | torturetest.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/torturetest.py b/torturetest.py index daaf7db0..c038fe52 100755 --- a/torturetest.py +++ b/torturetest.py @@ -59,12 +59,14 @@ class TestSite: rep += " using " + self.options return rep - def testmail(self): + def testmail(self, n=None): "Send test mail to the site." server = smtplib.SMTP("localhost") fromaddr = "esr@thyrsus.com" toaddr = "%s@%s" % (self.mailname, self.host) msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, toaddr)) + if n != None: + msg += `n` + ": " msg += "Test mail collected from %s.\n" % (self.id(),) server.sendmail(fromaddr, toaddr, msg) server.quit() @@ -73,6 +75,7 @@ class TestSite: "Run a mail fetch on this site." try: ofp = open(TestSite.temp, "w") + ofp.write('defaults mda "(echo; echo \'From torturetest\' `date`; cat) >>TEST.LOG"\n') ofp.write(site.entryprint()) ofp.close() (self.status, self.output) = commands.getstatusoutput("fetchmail -d0 -v -f - <%s"%TestSite.temp) @@ -139,9 +142,11 @@ if __name__ == "__main__": map(lambda x: sys.stdout.write(x.id() + "\n"), sitelist) sys.exit(0) elif switch == "-g": + i = 1 for site in sitelist: print "Sending test mail to " + site.id() - site.testmail() + site.testmail(i) + i+= 1 # Send test mail to each site sys.stdout.write("Delaying to give the test mail time to land...") time.sleep(5) |