Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Well, after a long time I found the problem. For some reason, using "www" as the hostname was causing the issue. Using "web" as hostname and re-running Exim config via dpkg-reconfigure fixed the problem.


I have the following setup:

  • a VPS, which is hosting my website (mydomain.com);
  • a hosting plan on Hostgator (which hosts several websites and takes care of mailing, including receiving mydomain.com mails).

I needed to have the VPS sending e-mails, so I had Exim4 setup on the VPS. I did setup the SPF too, according to Digital Ocean tutorials. It seems it's working fine, since my VPS can send e-mails to Gmail, Yahoo and Hotmail, using any "mydomain.com" e-mail address. But when I try to send e-mails from my VPS to test@mydomain.com or any other Hostgator e-mail address (which should be received by Hostgator server), it doesn't work.

That's the problem: when I send e-mails to any domain hosted on my Hostgator server, it fails. Any other (Gmail, Yahoo, Hotmail) works fine.

VPS Configuration:

  • hostname: www
  • FQDN: www.mydomain.com

DNS Configuration:

A @ 11.11.11.11
A mail 22.22.22.22
CNAME www @
MX 0 mail
TXT @ v=spf1 mx a ~all

The objective of this DNS config is to point all web traffic to 11.11.11.11 but if you mail someone@mydomain.com it should send the e-mail to 22.22.22.22.

Exim error log:

2014-04-01 13:05:17 1WUyNR-0001aS-R4 <= root@www.mydomain.com U=root P=local S=478
2014-04-01 13:05:18 1WUyNR-0001aS-R4 == felipe@anotherdomain.com R=dnslookup T=remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:<felipe@anotherdomain.com>: host doting.com.br [22.22.22.22]: 451 Temporary local problem - please try later
  • 11.11.11.11: My VPS IP;
  • 22.22.22.22: Hostgator server IP.

A not working verbose sending:

root@www:~# echo "test" | mail -v -s "test" felipe@anotherdomain.com
LOG: MAIN
  <= root@www.mydomain.com U=root P=local S=478
root@www:~# delivering 1WUz8Q-0001bE-OR
R: dnslookup for felipe@anotherdomain.com
T: remote_smtp for felipe@anotherdomain.com
Connecting to anotherdomain.com [22.22.22.22]:25 ... connected
  SMTP<< 220-br68.hostgator.com.br ESMTP Exim 4.80.1 #2 Tue, 01 Apr 2014 08:53:51 -0500
         220-We do not authorize the use of this system to transport unsolicited,
         220 and/or bulk e-mail.
  SMTP>> EHLO www.mydomain.com
  SMTP<< 250-br68.hostgator.com.br Hello www.mydomain.com [11.11.11.11]
         250-SIZE 52428800
         250-8BITMIME
         250-PIPELINING
         250-AUTH PLAIN LOGIN
         250-STARTTLS
         250 HELP
  SMTP>> STARTTLS
  SMTP<< 220 TLS go ahead
  SMTP>> EHLO www.mydomain.com
  SMTP<< 250-br68.hostgator.com.br Hello www.mydomain.com [11.11.11.11]
         250-SIZE 52428800
         250-8BITMIME
         250-PIPELINING
         250-AUTH PLAIN LOGIN
         250 HELP
  SMTP>> MAIL FROM:<root@www.mydomain.com> SIZE=1516
  SMTP>> RCPT TO:<felipe@anotherdomain.com>
  SMTP>> DATA
  SMTP<< 250 OK
  SMTP<< 451 Temporary local problem - please try later
  SMTP<< 503-All RCPT commands were rejected with this error:
         503-Temporary local problem - please try later
         503 Valid RCPT command must precede DATA
  SMTP>> QUIT
LOG: MAIN
== felipe@anotherdomain.com R=dnslookup T=remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:<felipe@anotherdomain.com>: host anotherdomain.com [22.22.22.22]: 451 Temporary local problem - please     try later

A working verbose sending:

root@www:~# echo "test" | mail -v -s "test" mygmail@gmail.com
LOG: MAIN
<= root@www.mydomain.com U=root P=local S=482
root@www:~# delivering 1WUzAr-0001bL-6d
R: dnslookup for mygmail@gmail.com
T: remote_smtp for mygmail@gmail.com
Connecting to gmail-smtp-in.l.google.com [2607:f8b0:400d:c00::1a]:25 ... failed: Network is unreachable
LOG: MAIN
  gmail-smtp-in.l.google.com [2607:f8b0:400d:c00::1a] Network is unreachable
Connecting to gmail-smtp-in.l.google.com [173.194.68.27]:25 ... connected
  SMTP<< 220 mx.google.com ESMTP g62si5353566qgg.196 - gsmtp
  SMTP>> EHLO www.mydomain.com
  SMTP<< 250-mx.google.com at your service, [11.11.11.11]
         250-SIZE 35882577
         250-8BITMIME
         250-STARTTLS
         250-ENHANCEDSTATUSCODES
         250 CHUNKING
  SMTP>> STARTTLS
  SMTP<< 220 2.0.0 Ready to start TLS
  SMTP>> EHLO www.mydomain.com
  SMTP<< 250-mx.google.com at your service, [11.11.11.11]
         250-SIZE 35882577
         250-8BITMIME
         250-ENHANCEDSTATUSCODES
         250 CHUNKING
  SMTP>> MAIL FROM:<root@www.mydomain.com> SIZE=1520
  SMTP<< 250 2.1.0 OK g62si5353566qgg.196 - gsmtp
  SMTP>> RCPT TO:<mygmail@gmail.com>
  SMTP<< 250 2.1.5 OK g62si5353566qgg.196 - gsmtp
  SMTP>> DATA
  SMTP<< 354  Go ahead g62si5353566qgg.196 - gsmtp
  SMTP>> writing message and terminating "."
  SMTP<< 250 2.0.0 OK 1396360583 g62si5353566qgg.196 - gsmtp
  SMTP>> QUIT
LOG: MAIN
=> mygmail@gmail.com R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [173.194.68.27]     X=TLS1.2:RSA_ARCFOUR_SHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
LOG: MAIN
  Completed

One more thing: when sending to gmail, the From appears to be "root@www.mydomain.com". I don't know if that's normal.


To be more clear:

  • VPS: just hosts the website mydomain.com and SEND e-mails (php e-mails), does not receive e-mails;
  • Hostgator server: works as mailer (receive and send) to mydomain.com.

Hostgator e-mails are working fine: tested mailing from mygmail@gmail.com to someone@mydomain.com and someone@anotherdomain.com and it's working good.

The problem is when I send e-mails from the VPS to some e-mail account hosted on my Hostgator plan.

Thanks in advance and sorry for my poor english.

share|improve this question
    
It seems some local problem on 11.11.11.11. Have you tried to send an email from gmail to the felipe@anotherdomain.com ? –  ALex_hha Apr 1 at 14:42
    
Looking at 451 Temporary local problem - please try later seems just what it says, a temporary problem in the remote mail server –  LinuxDevOps Apr 1 at 16:23
    
@ALex_hha 11.11.11.11 (the VPS) is not supposed to receive e-mails, just send. When I send an e-mail from my Gmail to someone@mydomain.com works fine. And if I send from Gmail to someone@anotherdomain.com works fine too. –  Felipe Apr 1 at 18:04
    
@LinuxDevOps it's really not a problem on the remote. It's working fine, as I can send and receive normally using Gmail. –  Felipe Apr 1 at 18:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.