Author: Chris Knadle Date: To: exim-users Subject: Re: [exim] Different local domain for bounces
On Wednesday, January 29, 2014 18:51:05 George wrote: > Good morning,
>
> I am running Exim 4.80 on Debian Wheezy.
>
> I have setup a "maildrop" with Dovecot, Exim and Fetchmail, where an
> internal server fetches mail from external POP3 and IMAP servers, stores it
> locally and serves it over IMAP to local Samba4 AD users. So far it works
> great. Now, I am trying to setup an SMTP relay so those users can point
> their mail clients to this internal server in order to *send *mail. I have
> configured Exim with my ISP's SMTP server as a smarthost, and it works fine.
>
> The missing part is correctly handling the bounces in case the ISP's SMTP
> server is down, for example. *I need all mail coming in from the users' PCs
> via port 25 to be relayed to the external SMTP, regardless of their
> destination (even for addresses belonging to the local domain) *(since some
> mobile users access the external mailbox directly).
>
> Let's say my domain is foo.com. If I set foo.com as a local domain, then
> mail from bar1@??? to bar2@??? gets delivered locally and never
> reaches the external SMTP server (not what I need)
Normally you would never do this; if you wanted to be able to email users on
the "local" mailhost, you'd use the FQDN to do htat, e.g. bar2@???
and the local box would have samba4.foo.com as a local domain only, and not
foo.com, but foo.com being a relay_domain.
> If I don't set foo.com as a local domain, mail reaches the external SMTP
> and gets back properly, but if the external SMTP is down then the bounce
> goes nowhere (it is obvious since it doesn't know it is a local mailbox)
I don't understand what you mean here. In this setup samba4.foo.com would
accept mail going to foo.com and remained queued until the mail times out,
which by default takes 5 days. You're saying the relayhost (i.e. external
SMTP) server can be down for > 5 days? That is settable to be a longer period
if you need longer. You also have the option of moving out the frozen
messages so that they don't time out and cause bounces, setting exim for
"queueonly" if you know the external SMTP is down... etc. There are options.
Once a bounce happens, it still has the box has had to give up on delivery,
and I think you're saying you'd like the user on the local box to get the
delivery failure notification. That sounds like you want to rewrite the
domain foo.com to be e.g. samba4.foo.com so that the failure notification goes
to the user on the local machine.
Is that correct? If so I think that's doable (though at the moment I'm not
yet thinking about how).
> How can I get those bounces to get locally delivered? I guess I need some
> way of specifying that foo.com needs to be considered as a local domain
> just for bounces, but regular mail to that domain needs to go through the
> external SMTP server.