Problems sending email on amazon server ec2

rigu

Registered
May 31, 2019
1
0
1
hongkong
cPanel Access Level
Root Administrator
Hi

Our server moved to amazon server ec2 after can't send emails from my server but can receive, we already in SecurityGroups open smtp port 25 and custom tcp 587, but no luck, we don't know the problem is from where cpanel or other issue , have anybody can help us?

Thank you!!!!!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
Hello @rigu,

Can you share the output from /var/log/exim_mainlog when attempting to send an email? EX:

Code:
exigrep "SUBJECT" /var/log/exim_mainlog
Replace SUBJECT with the subject of an email that you attempted to send out. Ensure to replace real domain names and IP addresses with examples when you paste the log output here.

Thank you.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
13,259
2,086
363
cPanel Access Level
Root Administrator
@alfanovatech.tk - I heavily edited your previous post to remove all the public information, but the root cause of the "retry time not reached for any host" error is usually a DNS resolution problem.

Are you able to look up the domain from your local server? For example, can you run the following command from your server?

Code:
dig mx domain.com
and get a positive result? If so, can you then connect to that mailserver with this command?

Code:
telnet result-of-previous-command 25
You may need to install telnet first with the "yum install telnet" command in order to perform that last test.
 

ServerHealers

Well-Known Member
Sep 21, 2015
92
51
68
India
cPanel Access Level
Root Administrator
@alfanovatech.tk In Amazon EC2 instances, there is a restriction by default for the SMTP port 25 which could be the reason. You should open a request to them explaining the need of 25 port for your business or server to remove this restriction there. For more information, please have a look through Remove port 25 restriction from your EC2 instance

Alternatively, you could use a smarthost relay in Exim to deliver the emails through it (Eg: Amazon SES, SpamExperts, MailChannels, Mail.baby, etc.)
 

alfanovatech.tk

Registered
Nov 23, 2022
2
1
3
Turkey
cPanel Access Level
Root Administrator
@cPRex
I followed your instruction and received this message.

telnet: result-of-previous-command: Name or service not known

can you guide me about it what is the actual issue. right now i received email in my webmail but when i send email recipient not received my emails.
 

ServerHealers

Well-Known Member
Sep 21, 2015
92
51
68
India
cPanel Access Level
Root Administrator
The one I mentioned about could be the actual reason. You should get in touch AWS support team to remove that SMTP restriction for your EC2 instance, or else use a smarthost relay in Exim to deliver the emails through it (Eg: Amazon SES, SpamExperts, MailChannels, Mail.baby, etc.)