PHP forms could not send mail to external MX for hosted domains

bokan

Verified User
Joined
Jul 3, 2011
Messages
19
My php forms could not send mail to an external MX for a hosted domain (if websites are on the server and MX are external like google services).

- I have checked the "use external MX checkbox".
- I have checked that the domaine is not listed in the file etc/virtual/domains
- I have reloaded exim service
- It is a debian 6 64bits (but there's no debian 6 64bit forum)

It appears that exims think the domain is local and try to send the mail locally.
Also, my customers using smtp can't send to other users using external MX (gmail)

I've read some threads like this one. But I don't find the answer.
http://www.directadmin.com/forum/showthread.php?t=35755&page=1
 
Some more info...

I found this in the exim main logs (/var/log/exim/mainlog) :



2011-12-14 15:58:31 1RaqHv-00072c-Kd <= [main_account_email] U=apache P=local S=843 id=8f5f42717c654eb7ef01da58f679637e@[website_domain] T="message object" from <[main_account_email]> for [dest_email_on_same_domain] [second_dest_email_on_gmail.com]
2011-12-14 15:58:32 1RaqHv-00072c-Kd ** [dest_email_on_same_domain] F=< [main_account_email]>: all relevant MX records point to non-existent hosts
2011-12-14 15:58:32 1RaqHv-00072c-Kd => [second_dest_email_on_gmail.com] F=<[main_account_email]> R=lookuphost T=remote_smtp S=871 H=gmail-smtp-in.l.google.com [209.85.229.27] X=TLSv1:RC4-SHA:128 C="250 2.0.0 OK 1323874364 ge9si1505133wbb.101"
2011-12-14 15:58:32 1RaqHw-00072f-PH <= <> R=1RaqHv-00072c-Kd U=mail P=local S=1697 T="Mail delivery failed: returning message to sender" from <> for [main_account_email]
2011-12-14 15:58:32 1RaqHw-00072f-PH ** [main_account_email] F=<>: all relevant MX records point to non-existent hosts
2011-12-14 15:58:32 1RaqHw-00072f-PH Frozen (delivery error message)
2011-12-14 15:58:32 1RaqHv-00072c-Kd Completed

where
[main_account_email] > the default email created by php my admin "da_user_name@default_domain.com"
[second_dest_email_on_yahoo.com] > a secondary adress that recieve the email normaly
[dest_email_on_same_domain] > an email whoose domain has a website on the server, the real dns is outside, the local dns has configured with MX pointing to gmail, and the checkbox "use external MX" is checked
 
The solution :
In the DNS I forgot to add the dot at the end of the MX record. So the value was considered as a subdomain.

aspmx1.google.com > aspmx1.google.com.mydomain.com
aspmx1.google.com. > aspmx1.google.com

So the mx could not resolve.

I think this is not clear for occasional DNS users. It will make it much more clear to append the domain at the end in another color when we forgot the dot.
aspmx1.google.com(.mydomain.com)

I know it's a feature for non real admins, but Directadmin is made for non real admins.
 
Back
Top