[Exim] rewrite based on subnet

Top Pagina
Delete this message
Reply to this message
Auteur: Steven Hanley
Datum:  
Aan: Exim Users
Onderwerp: [Exim] rewrite based on subnet
All

I wish to be able to only apply a rewrite rule to email that comes from
machines in given subnets rather than a whole domain.

Lets say there are a few thousand machines in domain.com however I only wish
to apply rewrite rules to mail I send out originating from machines in
192.168.160.0/24 and 192.168.164.0/24 and no others though they are all in the
same domain as machinename.domain.com.

I may however be looking at this wrong, the real issue is we have a top level
domain in which all computers sit, however only the email our users send from
machines in our area should be rewritten.

Currently I have the rewrite rule restricted to the *.domain.com however if
people elsewhere in the domain send email to someone in out area and their
username matches one of ours it gets rewritten.

*@*.domain.com ${lookup{$1}lsearch{/etc/mail.rewrite}{$value}fail} fFs

where mail.rewrite contains lines like

username:otheraddress@???

I suspect I may be able to do this by attaching the rewrite rule to some
specific part of the mail process, like the transport, however I cant quite
work out how or if it would be correct and only then rewrite for our own users
and not others.

We only relay for people on the subnets I wish to restrict this to if that
helps.

        See You
            Steve


--
sjh@??? http://wibble.net/~sjh
You are subtle as a window pane standing in my view
but I will wait for it to rain so that I can see you
Anticipate - Ani