We have the following setup:

  • One web-server on Debian with PHP on the main domain, that can send emails, but must not receive. It has exim4 installed. Let's call it example.com
  • One mail server on a different machine, that is used for both sending and receiving emails. This one would be mail.example.com.

I am only in charge of the first server, which was migrated. The second one is shared with other domains working fine. The problem is I can't make it send emails to the second one. When a user from a different domain uses the password reset option on our site, the new password is sent successfully to them, but when a user@example.com tries it, then the first server tries to deliver the mail locally. I tried setting it to relay to mail.example.com, but then it tries to send every single email through it, whether they belong there or not. I've exhausted the options given when I try dpkg-reconfigure exim4-config that I could think of. Most of them I don't understand, because half the time these unix people name things the exact opposite of what they mean.

  • 2
    In your case, example.com is no longer a valid FQDN, use e.g. web.example.com. Please give us more information on your configuration I tried sth. is not a helpful info.
    – sebix
    Apr 6, 2015 at 15:44
  • With dpkg-reconfigure I set it to internet mail to send and receive via SMTP for that domain and website. There isn't any other configuration info to give, that I have used, except the real names.
    – coladict
    Apr 6, 2015 at 16:09

2 Answers 2


Sending mail via a smarthost is a standard exim4 configuration. This meets the criteria you specify above.

Run dpkg-reconfigure exim4-config. Select the option mail sent by smarthost; no local mail. Then configure the second host as the smarthost.

  • I have no access to the second host. I don't even know who does, but that server is shared for many domains.
    – coladict
    Apr 6, 2015 at 16:11
  • 1
    @coladict You need to configure your host, not the second host. It should then forward you mail appropriately. Your domain will need an appropriate MX record to point to its mail server.
    – BillThor
    Apr 6, 2015 at 16:15
  • That doesn't actually tell me anything. When I tried searching what smarthost is I got tons of websites bragging about their software, but no definition to explain it to me.
    – coladict
    Apr 7, 2015 at 6:10
  • @coladict Smarthost is a central server that knows how to route mail. Just a term for a role not software. ISPs relays are the most commonly used smarthosts.
    – BillThor
    Apr 7, 2015 at 11:31
  • so you're saying I do need some control to the other server? Then there is no way to make it behave the way I need.
    – coladict
    Apr 7, 2015 at 18:17

Give the host a proper fully qualified domain name. This is one of the many problems that occur when you name a host with the naked domain name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.