Source: http://blog.itpub.net/786540/viewspace-1002077/
sudo apt-get install SendMail (which already contains the Sendmail-bin)
sudo apt-get install Sasl2-bin
---------------
The next two steps are not necessarily necessary, but I did
After the installation is complete, in the file/etc/default/saslauthd file, locate the Start=no, and modify it to Start=yes
/ETC/INIT.D/SASLAUTHD Start After modification
Verify:
Telnet localhost 25, in the console that appears, enter command EHLO localhost
Note: localhost is mainly looking at/etc/hosts files, general (not specifically, My machine is localhost:127.0.0.1, and specifically to do mail service is ubuntu:192.168.20.6) is playing aliases name, such as the IP address is not recognized.
To view the output information:
250-enhancedstatuscodes
250-pipelining
250-expn
250-verb
250-8bitmime
250-size
250-dsn
250-etrn
250-auth digest-md5 LOGIN PLAIN
250-deliverby
+ Help
If the above word appears, it is already available.
You can then use the local server directly to send mail via the Python smtplib module.
"Linux" Ubuntu stmp server Configuration