Tryign to send mail via a python script by using the local MTA

Jake Angulo jake.angulo at gmail.com
Thu Sep 19 23:56:57 EDT 2013


Up Robert Kern's reply!

I was waiting for smtplib <http://docs.python.org/2/library/smtplib> to be
mentioned... finally!  Instead people simply answer philosophically.  I
dont want to judge whether OP is a troll or not - but i found a lot of
arrogant replies here.  I have also worked on an antispam project before,
and see through the intents of the OP, but I do not pretend to be a
moralist. I was hoping we would strictly discuss code or software
architecture here, not morality. Simple question, simple answer pls, in the
interest of the Python list.

To the OP:

You might want to google smtplib, and use that instead of os calling a
system command. Smtplib takes care of all the operating system's quirks for
you, and still uses the os native sendmail program.

On the other hand, the way you are sending email is highly suspect, trying
to spoof a domain, random email address, etc.  It is not easy to fool most
modern email servers nowadays - especially gmail's.  They verify first that
the sending domain matches the IP of the sender.  And if you are trying to
do this - it is neither Python's nor the OS fault.

Happy coding!


On Tue, Sep 17, 2013 at 10:51 PM, Robert Kern <robert.kern at gmail.com> wrote:

> On 2013-09-17 13:11, Ferrous Cranus wrote:
>
>  There are members here like Tim Chase who said that they find it
>> interesting to
>> be able to do what i proposed.
>>
>
> No, he didn't. He was using sarcasm in a vain attempt to inspire you to
> search the Python documentation where you could easily find the standard
> SMTP library.
>
>   http://docs.python.org/2/**library/smtplib<http://docs.python.org/2/library/smtplib>
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>   -- Umberto Eco
>
> --
> https://mail.python.org/**mailman/listinfo/python-list<https://mail.python.org/mailman/listinfo/python-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130920/e04a40b3/attachment.html>


More information about the Python-list mailing list