On Tue, May 16, 2023 at 7:07 AM Tim Moody tim@timmoody.com wrote:
Thanks. That got me closer. I was not using ssl. When I took your code and tried to connect to localhost I got
STARTTLS extension not supported by server
*nod* The local relay is bound to localhost, so I guess we never worried about adding transport security. I would hope that things would work by just leaving out the starttls() call and related ssl setup. I have not tested that myself at this point however.
when I connected to mx-out03.wmcloud.org I got
(220, b'TLS go ahead')
But when I then do
server.sendmail("noreply@wikimedia.org", "tim@tim.com", ... """Subject: smtplib example from Cloud VPS ... ... ... ... Hello world. ... ... --- ... ... Bryan""")
I get SSL: WRONG_VERSION_NUMBER
I saw that in one of my own tests as well. I don't have a good explanation of what triggered it.
In the console /usr/sbin/sendmail -v tim@tim.com <email.txt
works just fine, so maybe I should just use subproc.
If shelling out to the sendmail client works for your use case, go for it! Simpler is nicer in most things. :)
Bryan