How to send email with exim if provider blocks outgoing connections to port 25?

Aspegic

Verified User
Joined
Aug 4, 2005
Messages
283
How to send email with exim if the provider blocks outgoing connections to port 25?

I installed DirectAdmin on a Google Compute VM.
Google blocks outgoing connections to port 25 (and unfortunately no, they will not unlock it if you ask them).
So, my exim won't send email.

I searched a lot trying to find an answer, but basically all solutions I found suggest to use some external service like Smtp.com or Sendinblue or Mailgun or SendGrid or Gmail or Outlook or Amazon SES etc which is not what I want.

Is it possible to force Exim to use port 587 instead of port 25 for outgoing connections?

I also searched for that solution but maybe I am not using the correct search-words, but I cannot find anything useful. You'll find zillions of search results explaining how to open port 587 for incoming connections, but not for outgoing. There are a few results I found, even in the directadmin documentation (referring to adding route_list to exim.routers.pre.conf), but that seems to work only when using an external smtp server, which I do not have, nor want.

Does anyone know how to force Exim to use port 587 to connect to other smtp servers?
Or any other solution that does not require an external third-party service?
 
Last edited:
Smtp relay. Sendgrid offers one, many others do too.

My providers blocks port 25 by default too, but they offer a relay server, not too hard to configure exim to send trough one of those
 
I already mentioned Sendgrid.
I am looking for a solution that does NOT require an external third-party service.

Specifically I am looking for a way to force Exim to use port 587 for outgoing connections, instead of port 25. Can this be done?
 
 
I think the problem is you can't force the receiving party to accept your mail on another port than 25. I could be wrong but I think that's what it comes down to.
 
I think the problem is you can't force the receiving party to accept your mail on another port than 25. I could be wrong but I think that's what it comes down to.
Usualy it's just outgoing that it's closed though.

Changing port could work, but that's the only first-party solution.

Ask the provider to open the port is another option, but you probably figured that out.
 
At least for changing the outgoing port, it seems I was already halfway.
I did find info on the daemon_smtp_ports setting, but I had not changed the two ACL lines.
Thank you @jayw1 for the link!

@Arieh: correct, it is unfortunate, but GCP blocks all outgoing connections with a destination port 25.

And I fear that kilobit is correct. I could change the port to 26 and use another smtp server to accept connections on that port, but that would basically be the same as using a third-party solution.

And the additional problem is that, yes, I can now connect to 587 on the destination server, but that server only accepts client connections on that port, requiering authentication. Only port 25 seems to be able to be used for email relay, 587 and 465 can only be used for normal smtp delivery (at least on google's smtp servers, those are the only ones I have tested so far).

Asking Google to open port 25 is futile though.

Damn :(

But thanks for the help guys, you're awesome!
 
Last edited:
Back
Top