diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2005-07-10 16:36:19 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2005-07-10 16:36:19 +0000 |
commit | b1a36249699361fd9b477b96981a3fda416de588 (patch) | |
tree | f5b9e7c190d9df004d42103ff4ef6d4947d28034 /dist-tools/test/torturetest.py | |
parent | 2db04d05ca4d6acefa83ece1f4a1bcc215dcf0c1 (diff) | |
download | fetchmail-b1a36249699361fd9b477b96981a3fda416de588.tar.gz fetchmail-b1a36249699361fd9b477b96981a3fda416de588.tar.bz2 fetchmail-b1a36249699361fd9b477b96981a3fda416de588.zip |
Pull out important configuration to the head of the script.
python2 -> python
svn path=/trunk/; revision=4106
Diffstat (limited to 'dist-tools/test/torturetest.py')
-rwxr-xr-x | dist-tools/test/torturetest.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/dist-tools/test/torturetest.py b/dist-tools/test/torturetest.py index f8a3535c..0b557382 100755 --- a/dist-tools/test/torturetest.py +++ b/dist-tools/test/torturetest.py @@ -1,7 +1,17 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import sys, getopt, os, smtplib, commands, time, gtk, gtk.glade +### CUSTOMIZE THESE! +# Mail address to use in From: header, user@host.domain format +fromaddr = "esr@thyrsus.com" +# local user name to receive mail as +localuser = "esr" +# server to inject mail into +smtpserver = "localhost" +# delay after sending mail +delay = 5 + protocols = ('POP3', 'APOP', 'IMAP',) class TestSite: @@ -57,8 +67,8 @@ class TestSite: def entryprint(self): "Print a .fetchmailrc entry corresponding to a site entry." rep = "poll %s-%s via %s with proto %s %s\n" \ - " user %s there with password '%s' is esr here" \ - % (self.host,self.protocol,self.host,self.protocol,self.options,self.username,self.password) + " user %s there with password '%s' is %s here" \ + % (self.host,self.protocol,self.host,self.protocol,self.options,self.username,self.password,localuser) if self.ssl and self.ssl != 'False': rep += " options ssl" rep += "\n\n" @@ -80,8 +90,7 @@ class TestSite: def testmail(self, n=None): "Send test mail to the site." - server = smtplib.SMTP("localhost") - fromaddr = "esr@thyrsus.com" + server = smtplib.SMTP(smtpserver) if self.mailaddr.find("@") > -1: toaddr = self.mailaddr else: @@ -283,7 +292,7 @@ if __name__ == "__main__": i+= 1 # Send test mail to each site sys.stdout.write("Delaying to give the test mail time to land...") - time.sleep(5) + time.sleep(delay) sys.stdout.write("here we go:\n") # Fall through elif switch == "-v": |