skip to Main Content

Anybody here has experience with configuration SMTP on Cpanel host by AWS EC2.

After I have done configurations, DKIM is valid, SPF is valid, but PTR is not valid (reverse DNS). Then when I sent a test email to mail-tester.com, it was 3/10. Here is the error message

We didn't find a server (A Record) behind your hostname ip-172-31-1-135.ap-southeast-1.compute.internal.

You may want to publish a DNS record (A type) for the hostname 
ip-172-31-1-135.ap-southeast-1.compute.internal or use a different hostname in your mail software.

I’m a newbie for DNS stuff, if you need more information, please give me a comment.

3

Answers


  1. Chosen as BEST ANSWER

    Finally, I got 9.8/10 after tweaking some configuration and waiting for AWS Support to map Elastic IP to my domain name, then I can get 10/10

    enter image description here

    Most importantly, have to make sure hostname has to your my domain 1. set hostname sudo hostname cpanel.mydomain.com

    1. Set it automatically
    cd /etc/dhcp/dhclient-exit-hooks.d/
    sudo nano set-hostname.sh
    

    file set-hostname.sh

    #!/bin/sh
    hostname cpanel.mydomain.com
    /scripts/fixetchosts
    

    For more detail, please free to reference here


    1. You should configure your mail server software to use your custom hostname (for example mail.example.com), not the AWS assigned default (such as ip-172-31-1-135.ap-southeast-1.compute.internal)

    2. You need to contact AWS support to have PTR record configured https://aws.amazon.com/blogs/aws/reverse-dns-for-ec2s-elastic-ip-addresses/

    3. Keep in mind that Amazon EC2 throttles traffic on port 25 of all EC2 instances by default, but you can request for this throttle to be removed: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/

    Login or Signup to reply.
  2. If you want to receive emails on this server you can’t change port number from 25 to something else as other servers will try to connect on this port to deliver emails. You also have to ask AWS to remove throttle on port 25 as stated before.

    If you haven’t already, create A DNS record for cpanel.mydomain.com pointing to your elastic IP (it is important that you have elastic IP not automatically assigned public IP)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search