Postal web interface sends emails to the wrong SMTP port
goldmont opened this issue · comments
Describe the bug
Postal forces port 25 when sending emails from its web interface to itself but SMTP is running on port 2525. Is there a way to set a custom port for the web interface? Postal works perfectly when sending to port 2525 from other services.
I get the error:
No SMTP servers were available for mail.example.com. Invalid argument - connect(2) for "<ip_address>" port 25, execution expired
Expected behaviour
Being able to send emails to port 2525 via Postal web interface.
Screenshots
Environment details
- OS: Debian 12
- Browser: Chrome
- Version: Postal 3.2.2
When you say "Is there a way to set a custom port for the web interface?" what do you mean? What e-mails are you talking about?
When you say "Is there a way to set a custom port for the web interface?" what do you mean? What e-mails are you talking about?
I mean that Postal keeps sending emails to port 25 but my SMTP is running on port 2525. When I send an email via the Send message
form (see the screenshot), Postal fails to deliver the message because it's trying to send it to port 25.
Of course example.com
is not my real domain.
I see now.
No, that's not possible. If you want to receive incoming email to your Postal install from other mail servers (and Postal itself) you will need to listen on port 25.
Postal does not treat outgoing mail any differently whether it's going to itself or any other external server.
I see now.
No, that's not possible. If you want to receive incoming email to your Postal install from other mail servers (and Postal itself) you will need to listen on port 25.
Postal does not treat outgoing mail any differently whether it's going to itself or any other external server.
So could you please explain me what is the purpose of letting the user to set a custom port while creating a new SMTP endpoint? There's something I don't understand or missing in the documentation.
SMTP endpoints are used to route incoming mail to other servers. For example, you can setup specific addresses to go to other servers.
For future people coming here, I just wanted to add that there is a massive difference between using Postal to send emails via SMTP or API and using the incoming routing.
If you wanted to use the incoming routing, you would have to have a domain with its MX records pointing at Postal and then probably use something else to send the message to that domain (I'm not sure if Postal would be able to SMTP to itself).
Using Postal directly to send messages via SMTP or API will always use the standard port.