Using pythons smtp server

Grant Edwards invalid at invalid.invalid
Fri Dec 13 21:33:38 CET 2013


On 2013-12-13, Vincent Davis <vincent at vincentdavis.net> wrote:
> Grant, Chris
> Thanks !!!

> I guess in the end this is a bad idea, (for my purposes) I should just use
> my gmail account smtp server.

If you're going to claim the mail is from <somebody>@gmail.com, then
yes you should definitly send it via Gmail's SMTP server.  Doing
anything else is going to be a long, losing battle involving you
learning more about SMTP and e-mail headers than you probably want to.

If you've got your own domain (which you're using as the "from"
address), a static IP, and your own MX record and corresponding SMTP
server, you should be able to set things up to send mail directly.

Many years ago (like 20), I used to configure my home Linux boxes to
send mail directly to the destination SMTP server while claiming to be
from "grante@<my-isp's-name>.com".  At first it worked fine that way.
Then about about 12-15 years ago, I started having problems with some
servers refusing my mail.  I had a static IP address with a real,
official hostname, so I set up an MX record for that hostname, and
made sure my handshaking configuration was using a hostname that
mapped back to my static IP address.  That helped for a while, but
SMTP servers continued to get more and more paranoid.  Some SMTP
servers won't accept mail from an IP if they've determined is a
"residential" IP address even if you do have a domain that matches the
"from" address, an MX record, and everything else.

Eventually, I just gave up and started routing everything through the
"official" SMTP server associated with the e-mail address from which I
wanted to send the mail.

-- 
Grant Edwards               grant.b.edwards        Yow! I'm having a MID-WEEK
                                  at               CRISIS!
                              gmail.com            



More information about the Python-list mailing list