It is confusing. When you read about it you will see that there are a few ports used for email transmission. For SMTP, 3 ports seem to be standardized.
I was confused once, so I read about it. Implemented my services then forgot about them.
I’m confused again today, so I decided to write this little note:
- Port 587 is for email submission by an authenticated user (with optional encryption using the STARTTLS command).
- Port 465 is for email submission by an authenticated user (with implicit TLS. i.e. only encrypted traffic is assumed here). This port has a history of issues, which can be read about in RFC-8314. The final verdict is that IANA likes to use it, because it is encrypted by default, so it’s less prone to MITM attacks (unlike STARTTLS), even though it has a history of conflict, and that a different port (587) is already assigned for a similar task.
- Port 25 is for email transmission (anonymously) between mail servers.