diladele / websafety

Simple and powerful web filter for HTTP and HTTPS traffic
https://www.diladele.com
241 stars 24 forks source link

port 465 of smtp mailer needs to start the TLS initially and not starttls (validate both for python and C# maileirs) #2195

Closed ra-at-diladele-com closed 3 months ago

ra-at-diladele-com commented 5 months ago

From https://stackoverflow.com/questions/24672079/send-email-using-smtp-ssl-port-465

ra-at-diladele-com commented 5 months ago

seems we are out of luck in new C# implementation - from https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient.enablessl?view=net-8.0

The [SmtpClient](https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=net-8.0) class only 
supports the SMTP Service Extension for Secure SMTP over Transport Layer Security as defined in RFC 3207. 
In this mode, the SMTP session begins on an unencrypted channel, then a STARTTLS command is issued by
the client to the server to switch to secure communication using SSL. See RFC 3207 published by the Internet 
Engineering Task Force (IETF) for more information.

An alternate connection method is where an SSL session is established up front before any protocol commands are sent. 
This connection method is sometimes called SMTP/SSL, SMTP over SSL, or SMTPS and by default uses port 465. 
This alternate connection method using SSL is not currently supported.
ra-at-diladele-com commented 5 months ago

So postponing for now.

ra-at-diladele-com commented 3 months ago

The mailer was now switched to golang - Office 365 seems to work fine. Closing for now.