SMTP
Simple Mail Transport Protocol http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol The EMail protocol involved in sending messages (typically from sending-user to sender's server to recipient's server).
on mimicing via Telnet - good for testing servers
A server which uses SMTP is typically called a Mail Transport Agent (MTA).
There are a number of Open Source MTA apps (SendMail, PostFix, Q Mail, ExIm). This piece provides a very short comparison.
Some 2021 notes
- you definitely want an ESP to provide identity/reputation etc
- the ESP will have a "feedback loop" with some email providers which will tell you about spam issues. But Google doesn't support that.
- Email authentication systems like SPF and DKIM reduced some of the spam flow (and made it harder to run your own email host, esp as an individual). https://en.wikipedia.org/wiki/Email_authentication https://www.alexblackie.com/articles/email-authenticity-dkim-spf-dmarc (SpamWars)
VERP: Variable Envelope Return Path
- to make it easier to track bounce messages associated with forwarded emails
- http://cr.yp.to/proto/verp.txt
- PostFix http://www.postfix.org/VERP_README.html
- http://en.wikipedia.org/wiki/Variable_envelope_return_path
The protocols associated with reading EMail are POP and IMAP.
notes on writing code to send messages
get better performance from holding single SMTP connection object for multiple messages sent
- but if a send fails (because of bad address or something) the connection often gets hosed (e.g. your next 'send' gets a 'nested command' error or something like that)
- so typically call 'quit' on the connection
- so have to re-create a connection or the next send in the batch will fail
- or is there a 'reset' function I could use instead of 'quit'?
- there's a low-level 'RSET' command, but will avoid for now
- conclusion: just use a separate connection per message for now (I would welcome input from a Python guru...)
Back in 2008 I wrote Python code to process email blocks/errors
- we were sending email to 1M people
- we were just writing code to push to PostFix which did the sending
- we didn't have any hooks catching responses in realtime
- so I wrote code which scraped (by parsing the files)
- the inbox of the account we sent from
abuse
andpostmaster
inboxes which would get feedback loop messages
- (these days, to get decent deliverability, you probably have to use an ESP, and they handle all this automatically, though you might have to do work if you want to dig into the data on blocked accounts)
Edited: | Tweet this! | Search Twitter for discussion