-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathREADME
26 lines (19 loc) · 1.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
smtptest.py: command-line smtp test mail sender
I use this to programmatically test the security of my email server setups. With this Python app it's easy to script various combinations to SMTP sending options to make sure your email server behaves as you expect, both inside the firewall and out.
Usage: python smtptest.py [options] fromaddress toaddress serveraddress
Options:
-h, --help show this help message and exit
-t, --usetls Connect using TLS, default is false
-s, --usessl Connect using SSL, default is false
-n nnn, --port=nnn SMTP server port
-u username, --username=username
SMTP server auth username
-p password, --password=password
SMTP server auth password
-v, --verbose Verbose message printing
-d n, --debuglevel=n Set to 1 to print smtplib.send messages
Examples:
python smtptest.py [email protected] [email protected] mail.example.com
python smtptest.py --debuglevel 1 --usetls -u bob -p xyzzy "Bob <[email protected]>" [email protected] mail.example.com
At verbose == False and debuglevel == 0, smtptest will either succeed silently or print an error. Setting verbose or a debuglevel to 1 will generate intermediate output.
See also http://docs.python.org/library/smtplib.html