SMTP server w/o using Twisted framework
Jeff McNeil
jeff at jmcneil.net
Thu Jul 5 15:37:49 EDT 2007
Inline...
On 7/5/07, _spitFIRE <timid.Gentoo at gmail.com> wrote:
> On Jul 5, 1:34 pm, "Jeff McNeil" <j... at jmcneil.net> wrote:
> > If you just want to send mail, you should be able to use the standard
> > smtplib module (http://docs.python.org/lib/module-smtplib.html). If
> > your recipients are on the Internet, you would need to handle MX
> > resolution yourself.
> >
>
> How complicated is to handle the MX resolution by myself? I'm sorry
> that I don't have a clue regarding that. Any pointers would be greatly
> appreciated.
You could try pyDNS (http://pydns.sourceforge.net). You should simply
be able to call the 'DNS.mxlookup' function. The other option would
be twisted.names...
>
> > I know you said you want to avoid a relay server, but it's probably
> > the best bet unless you control the SMTP infrastructure or are simply
> > sending messages locally.
>
> The problem is that with the scenario I'm faced with, I don't have any
> reliable SMTP server that I can use. Hence, I though I will spawn my
> own light-weight SMTP server that can send mails to the people I want,
> on the Internet. But, from what you are saying it seems, it might not
> be that light weight after all!
What about simply running an SMTP server on the machine running your
application? Is that a possible approach?
>
> > Otherwise, you'll probably need to also
> > implement queuing and retry logic (depending on your requirements).
>
> Isn't there a library module that can help me implement all this?
Not that I know of. The protocol is standard, the queuing and retry
logic, not so much. Someone else may know more than I, though.
>
> > There are also some warning lights that may go off and flag your mail
> > as spam if you're using a method like that...
> >
> > -Jeff
>
> Would you please fill me in with some pointers as to why my mail might
> get flagged as spam? Would it be considered spam even if I've a valid
> from address, and a proper message/subject? Does the spam filter also
> rely on the sending server's DNS etc because of which you say it might
> get flagged as spam?
>
http://mtamark.space.net/draft-stumpf-dns-mtamark-04.html
http://en.wikipedia.org/wiki/Sender_Policy_Framework
> --
> http://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list