TomTicket
By:
TomTicket

Exim dont sending email to emails with my domain

October 7, 2014 5k views

Hi, i using php to send emails, but when a try send a email to contact@mydomain / support@mydomain, they don't send.

But, when send a email to personalemail@gmail.com, personalemail@live,..., they works.

How i can fix this?

1 Answer

For starters, have you check your exim mainlog?

That would give you any error related to the emails not been send. We can take a look at your mainlog file if you post it here and try to help

  • The log said:

    2014-10-07 10:38:41 1XbVuT-0005Wl-W6 <= www-data@mysite.com U=www-data P=local S=451
    2014-10-07 10:38:42 1XbVuU-0005Wq-0n <= www-data@mysite.com U=www-data P=local S=447
    2014-10-07 10:38:42 1XbVuU-0005Wq-0n ** contato@mysite.com: Unrouteable address
    2014-10-07 10:38:42 1XbVuU-0005Wv-1a <= naoresponda@mysite.com U=www-data P=local S=677 id=5433faf2077ea@mysite.com
    2014-10-07 10:38:42 1XbVuU-0005Ww-1Z <= <> R=1XbVuU-0005Wq-0n U=Debian-exim P=local S=1266
    2014-10-07 10:38:42 1XbVuU-0005Wq-0n Completed
    2014-10-07 10:38:42 1XbVuU-0005Wv-1a ** suporte@mysite.com: Unrouteable address
    2014-10-07 10:38:42 1XbVuU-0005Ww-1Z == www-data@mysite.com R=local_user T=maildir_home defer (13): Permission denied: cannot chdir to /var/www/Maildir
    2014-10-07 10:38:42 1XbVuU-0005X3-2q <= <> R=1XbVuU-0005Wv-1a U=Debian-exim P=local S=1505
    2014-10-07 10:38:42 1XbVuU-0005Wv-1a Completed
    2014-10-07 10:38:42 1XbVuU-0005X3-2q ** naoresponda@mysite.com: Unrouteable address
    2014-10-07 10:38:42 1XbVuU-0005X3-2q Frozen (delivery error message)
    
    
  • Were you able to solve your problem? Are you running the latest version of exim?

  • The error persists.

    I downloaded the latest version.

  • Can you post the contents of /etc/aliases?

  • The content o etc/aliases is:

    postmaster: root
    root: digitalocean

  • The erro log says to:

    2014-10-23 14:45:17 2XhLVl-1237nQ-Mg <= root@my-site.com U=root P=local S=2207
    2014-10-23 14:45:17 2XhLVl-1237nQ-Mg ** digitalocean@my-site.com root@my-site.com: Unrouteable address
    2014-10-23 14:45:17 1XhLVl-0007nU-NQ <= <> R=2XhLVl-1237nQ-Mg U=Debian-exim P=local S=3064
    2014-10-23 14:45:17 1XhLVl-0007nU-NQ ** digitalocean@my-site.com root@my-site.com: Unrouteable address
    2014-10-23 14:45:17 1XhLVl-0007nU-NQ Frozen (delivery error message)
    2014-10-23 14:45:17 2XhLVl-1237nQ-Mg Completed

  • digitalocean@your-site.com does not exist, you need to either create a user for it (How To Add and Delete Users on an Ubuntu 14.04 VPS | DigitalOcean) or set it as an alias to an existing user:

    /etc/aliases:

    postmaster: root
    root: existing user name
    contact: existing user name
    support: existing user name
    

    and run

    sudo newaliases
    sudo service exim restart
    
  • Try removing root: root and running:

    sudo newaliases
    sudo service exim restart
    

    again. Does that fix it?

  • Nope, dont work.

    The error log say:

    2014-10-23 16:59:23 1XhNbW-0004TC-VT == /var/mail/mail (root@my-site.com) contato@my-site.com R=mail4root T=addressfile defer (13): Permission denied: creating lock file hitching post /var/mail/mail.lock.my-site.com.5449500b.00004326 (euid=8 egid=8)
    2014-10-23 16:59:24 1XhNbW-0004TC-VT => personalemail@gmail.com R=dnslookup T=remote
    smtp H=gmail-smtp-in.l.google.com [74.125.28.27] X=TLS1.2:RSAARCFOURSHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com" C="250 2.0.0 OK 1414090764 uh7si2269655pac.156 - gsmtp"
    2014-10-23 16:59:24 1XhNbY-0004TK-FY <= <> R=1XhNbW-0004TC-VT U=Debian-exim P=local S=6692
    2014-10-23 16:59:24 1XhNbY-0004TK-FY ** naoresponda@my-site.com: Unrouteable address
    2014-10-23 16:59:24 1XhNbY-0004TK-FY Frozen (delivery error message)

    Most important:

    Permission denied: creating lock file hitching post /var/mail/mail.lock.my-site.com.5449500b.00004326

Have another answer? Share your knowledge.