4 ms·
Does this mean emails sent from EC2 will not be automatically marked as spam? (right now I think Hotmail marks all EC2 emails as spam). I read that reverse DNS
by kirubakaran 19y ago
Does this mean emails sent from EC2 will not be automatically marked as spam? (right now I think Hotmail marks all EC2 emails as spam). I read that reverse DNS and PTR records are needed to accomplish this. So, this solves just half the problem?
I am asking these as exploratory questions... I don't really have a good grasp on what I am talking about. Please point me to resources.
BTW, do you know of any sample Python code that is used to act on incoming emails in the server?
- SwellJoe 19y agoAmazon probably provides PTR records for all of their IPs. You can check with the host command on Linux: host 10.1.1.1 You'll also want an SPF record for your zone: http://www.openspf.org/ http://www.openspf.org/ DomainKeys are being checked by some webmail providers, but it's only a non-spammy characteristic at this point, not mandatory for delivery. As long as nothing else about your message is stupid (e.g. RFC compliant SMTP server, reasonable DNS records, and you aren't sending 100 per minute to addresses in the same domain), it'll go through. I'd suggest using whatever Python library will allow you to send using a real SMTP server (or just pipe your email into the mail or sendmail command, which use the local smtpd to send, by default), like Postfix or Sendmail. There may be a standalone library that is actually RFC compliant and handles error conditions properly, but it seems unlikely from a historical standpoint (most such libraries, particularly in the PHP world, are renowned for epic failure). As long as Postfix or Sendmail are configured properly, your mail will be RFC-compliant and will look far less spammy than those coming from a half-assed implementation of the spec.
- kirubakaran 19y agoGreat! Thanks. Can you please point me to some how-to about acting on incoming email using Python? I look far and wide but couldn't find much.
- SwellJoe 19y agoI have no idea. I haven't worked with Python in several years. But, I know that both Mailman and Trac are written in Python and they both do stuff with incoming mail...so, there's certainly some python code out their for dealing with incoming mail. That's where I'd start my search if I were in your shoes.
- kirubakaran 19y agoThanks.
- alphamule 19y agoone way to do it is to use procmail to filter incoming mail and piping the ones you are interested into your python program which will take the rfc822 message on stdin. the email module (http://docs.python.org/lib/module-email.html http://docs.python.org/lib/module-email.html) will let you parse these messages. this is provided that your MX dns entry points to your machine and that you have the appropriate ports unlocked, of course.
- jeremiah 19y agoWell if you want Python there is pyzor. But the grand-daddy of them all is SpamAssassin, and that is perl. :) FTW!