Exim, hot to route local mail to other adress

Posted by kheraud on Server Fault See other posts from Server Fault or by kheraud
Published on 2014-05-25T14:42:15Z Indexed on 2014/05/30 15:33 UTC
Read the original article Hit count: 210

Filed under:
|
|

I have setuped an Exim4 server on my debian wheezy server. This mail server only sends mail coming from localhost. The purpose is sending mail for my website.

I have cron tasks and other services generating mails for root user. These mails are not stored in /var/mail as before, but sent by exim to [email protected].

I try to make exim send mails for root to [email protected] rather than [email protected].

I tried adding a .forward in /root with [email protected] as content. I tried also changing /etc/aliases with root: [email protected]. The fact is that routing works for root@localhost but not for root which is resolved as [email protected]

I tested how routing is resolved with exim -bt :

root@srv02:~# exim -bt root@localhost
R: system_aliases for root@localhost
R: dnslookup for [email protected]
[email protected]
    <-- root@localhost
  router = dnslookup, transport = remote_smtp
  host gmail-smtp-in.l.google.com      [173.194.67.27] MX=5
  host alt1.gmail-smtp-in.l.google.com [74.125.143.27] MX=10
  host alt2.gmail-smtp-in.l.google.com [74.125.25.27]  MX=20
  host alt3.gmail-smtp-in.l.google.com [173.194.64.27] MX=30
  host alt4.gmail-smtp-in.l.google.com [74.125.142.27] MX=40
root@srv02:~# exim -bt root
R: dnslookup for [email protected]
[email protected]
  router = dnslookup, transport = remote_smtp
  host aspmx.l.google.com      [173.194.78.27] MX=1
  host alt1.aspmx.l.google.com [74.125.143.27] MX=5
  host alt2.aspmx.l.google.com [74.125.25.27]  MX=5
  host alt4.aspmx.l.google.com [74.125.142.27] MX=10
  host alt3.aspmx.l.google.com [173.194.64.27] MX=10

I bet this is a matter of how my server is configured (rather than how exim is configured). But to understand well I would like to have a solution for both :

© Server Fault or respective owner

Related posts about exim

Related posts about hostname