[exim] Stopping unwanted relaying

Etusivu
Poista viesti
Vastaa
Lähettäjä: Mike Clarke
Päiväys:  
Vastaanottaja: exim-users
Aihe: [exim] Stopping unwanted relaying
My pop3 mail is collected from a couple of different ISP's by fetchmail and
then passed through to Exim for local delivery to the appropriate users.

I collect mail for 2 different domains, e.g. mydomain.example for which I
collect all mail and otherdomain.example for which I only collect mail for a
selection of mailboxes.

The following router in my config file (with domain name munged for this post)
ensures that mail for my aliases at otherdomain.example go into my local
mailbox:

  otherdomain:
    driver = redirect
    domains = otherdomain.example
    local_parts= admin : history : sales
    data = mike


Normally this works fine until I get an email for otherdomain.com which has
additional otherdomain.example recipients in the To or Cc headers, e.g.
otheruser@???. Since this user isn't handled by the above
router it eventually gets picked up by the router for my ISP's smarthost:

  smart_route:
    driver = manualroute
    domains = !+local_domains
    transport = remote_smtp
    route_list = * my.isp.example


The unfortunate recipient then gets 2 copies of the email, one delivered
through normal channels and a second effectively relayed by me. I can't
simply add otherdomain.example to my local_domains list since that would
prevent me from sending emails to other people on that domain. This only
happens for recipients at otherdomain.example, if there are other recipients
in the list but in a totally different domain Exim doesn't attempt to send
anything to them.

I need some way of preventing the smart_route router from being applied to
emails which have been processed by fetchmail, if the recipient isn't one of
those specified in the otherdomain router they should be silently deleted
without any bounce message. These mails will all have a header line
like "Received: from my.isp.example by kestrel.lan with POP3
(fetchmail-6.3.5)" - could anybody advise me what rule(s) I need to create to
filter out these emails?

--
Mike Clarke