Thứ Năm, 24 tháng 10, 2019

Setup local email webserver using cPanel

Step 1: Be sure to use cPanel dash board to create new email
Step 2: Configure Email Routing via cPanel>Email>Email Routing
Choose the domain associated with the email you wanna setup and pick the Local Email Exchanger as below picture

Step 3: Check MX record: Go to cPanel>Domain>Domain Zones and click on the domain you want to setup email
 If it doesn't has abnormal domain show in the MX record, it's ok

Step 4: Go check your DNS record. This is more technically detail compare to step 3. Any change in this DNS record can bypass what ever you've done with step 3. So, be careful!
The DNS record from godaddy services should looks like this

Don't bother the details of the value of each record. MX record should point to the domain (or subdomain, e.g email.yourdomain.com) If you haven't receive external email according to the MX record, mostly you're having wrong configuration of MX record.
Using https://mxtoolbox.com/domain/yourdomain.com/ to check yourdomain.com issues. If it doesn't has a DMARC record. Proceed next step!
Step 5: Add DMARC record. View this video first:
ok, if you use godaddy DNS managing tools, all you need to do is add an txt record with:
domain: _dmarc (don't know why godaddy always automatically add yourdomain.com as the suffix)
value: choose one of those shit:
None: v=DMARC1; p=none; sp=none; rf=afrf; pct=100; ri=86400
Reject: v=DMARC1; p=reject; sp=none; rf=afrf; pct=100; ri=86400
Quarantine: v=DMARC1; p=quarantine; sp=none; rf=afrf; pct=100; ri=86400
Alternately, you can request an email report of failed DMARC validations by adding a valid email address, such as the following:
None: v=DMARC1; p=none; sp=none; ruf=mailto:user@example.com; rf=afrf; pct=100; ri=86400
Reject: v=DMARC1; p=reject; sp=none; rf=afrf; pct=100; ruf=mailto:user@example.com; ri=86400
Quarantine: v=DMARC1; p=quarantine; sp=none; ruf=mailto:user@example.com; rf=afrf; pct=100; ri=86400
Step 6: If you want to have spf record, check this post: https://support.google.com/a/answer/33786?hl=en

Further shit: if  mxtoolbox.com  find out that SOA time response is so long, you need to change to another webserver. Buy a better service.