drewr / postal

Clojure email support
MIT License
586 stars 85 forks source link

Consider switch default TLS port to be 587 instead of 465 #115

Open ieugen opened 3 months ago

ieugen commented 3 months ago

Hi,

I noticed the default port is 465 and I believe it should be 587 as this is the standardized port for TLS email.

https://github.com/drewr/postal/blob/4176469831637b0860279dbbd3f9e610ed1946cb/src/postal/smtp.clj#L51

Port 465 is mentioned in this RFC https://www.rfc-editor.org/rfc/rfc8314.html and has this section describing the IANA registration issue with 465 https://www.rfc-editor.org/rfc/rfc8314.html#section-7.3 .

Here is a list of articles / providers that mention 587 as the more appropriate port to use:

As an alternative, you can also use port 587 to send emails via external mail delivery services. Port 587 is not blocked and can be used without sending a limit request.

SendGrid accepts unencrypted and TLS connections on ports 25, 587, & 2525. You can also connect via SSL on port 465. Many hosting providers and ISPs block port 25 as a default practice. If your Telent session continually times out or will not connect using port 25, it is likely that your ISP or hosting provider is blocking the port. You can contact your host/ISP to find out which ports are open for outgoing SMTP relay. We recommend using port 587 to avoid any rate limiting that your server host may apply.