how to use smtp starttls() encryption?

Gerhard Häring gerhard.haering at gmx.de
Sun Nov 3 11:04:58 EST 2002


Xu, C.S. wrote in comp.lang.python:
> Gerhard,
> 
> You saved me! Why don't I need s.login(fromEmail, password) 
> to identify myself after s.starttls() ?

Because the smtp server is configured in a way that you don't? :)

> Earlier when our mail server don't require TLS, it need check mail
> before sending out, or use s.login(fromEmail, password) to identify
> myself.

'Sending out' is configured differently than receiving mail. Note that
in my example, I sent mail to your domain, using your smtp server,
which is thus already the 'final destination'.

No relaying involved here. The main point of SMTP auth is to prevent
unauthorized relaying, and therefore you require it only for mail to
domains other than yours.

For interoperability with the rest of the world, you cannot even do
otherwise, because then you could receive no more mail.

> What the hell s.starttls() is doing? There just no slightest clue
> in python lib reference.

There is. Be sure to read in the Python 2.2.x docs, as this feature
didn't exist in earlier versions.

-- Gerhard



More information about the Python-list mailing list