diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-18 17:40:04 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-18 17:40:04 +0000 |
commit | 2e153375b52c7cdbe366f0c76592172ce72659a6 (patch) | |
tree | 53fa6511397d7129542d3cd1aad1e0d676a8d3d0 /torturetest.py | |
parent | 3bd99f28cac40e06c52d55b6f883f305d437ccec (diff) | |
download | fetchmail-2e153375b52c7cdbe366f0c76592172ce72659a6.tar.gz fetchmail-2e153375b52c7cdbe366f0c76592172ce72659a6.tar.bz2 fetchmail-2e153375b52c7cdbe366f0c76592172ce72659a6.zip |
New database format.
svn path=/trunk/; revision=3115
Diffstat (limited to 'torturetest.py')
-rwxr-xr-x | torturetest.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/torturetest.py b/torturetest.py index a75f6ac0..1c8bd35b 100755 --- a/torturetest.py +++ b/torturetest.py @@ -7,16 +7,18 @@ class TestSite: def __init__(self, line): "Initialize site data from the external representation." - (self.host, self.userid, self.password, \ + (self.host, self.mailname, self.userid, self.password, \ self.proto, self.options, self.capabilities, self.version, self.comment) = \ line.strip().split(":") + if not self.mailname: + self.mailname = self.userid # Test results self.status = None self.output = None def allattrs(self): "Return a tuple consisting of alll this site's attributes." - return (self.host, self.userid, self.password, \ + return (self.host, self.mailname, self.userid, self.password, \ self.proto, self.options, self.capabilities, \ self.version, self.comment) @@ -27,6 +29,7 @@ class TestSite: def prettyprint(self): "Prettyprint a site entry in human-readable form." return "Host: %s\n" \ + "Mail To: %s\n" \ "Userid: %s\n" \ "Password: %s\n" \ "Protocol: %s\n" \ @@ -58,7 +61,7 @@ class TestSite: "Send test mail to the site." server = smtplib.SMTP("localhost") fromaddr = "esr@thyrsus.com" - toaddr = "%s@%s" % (self.userid, self.host) + toaddr = "%s@%s" % (self.mailname, self.host) msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, toaddr)) msg += "Test mail collected from %s.\n" % (self.id(),) server.sendmail(fromaddr, toaddr, msg) @@ -167,7 +170,7 @@ if __name__ == "__main__": print "Bad status was returned on the following sites:" for site in sitelist: if site.failed(): - sys.stdout.write(site.explain()) + sys.stdout.write(site.explain() + "\n") except KeyboardInterrupt: print "Interrupted." |