On Tue, 14 Dec 1999, Milos Prudek wrote:
> > > Can I carbon copy mail sent out by exim, if it comes from specified IP?
>
> Actually, it does come from a specified IP, but first it goes thru
> internal mailserver. Therefore I can't use $sender_host_address, because
> that is always the address of internal mailserver.
Get the internal mailserver to add a header to the message as it comes
through:
headers_remove = it-came-from-1.2.3.4
headers_add = ${if eq{$sender_host_address}{1.2.3.4}{it-came-from-1.2.3.4:}}
Then you can simply test for that header.
> I guess I must use
> $message_headers, like this:
>
> copymail:
> driver=domainlist
> transport=remote_smtp2 # I need to use SMTP, local_delivery is not
> enough.
> condition=($message_headers="*1.2.3.4*")
> route_list="*.ourdomain.com internal.smtp.server byname; *
> our.parent.smtp.server"
>
> Is the condition option correct?
No. You need something like
condition = ${if matches{$received:}{^.*1\\.2\\.3\\.4}{yes}{no}}
since you want to check only the Received: headers.
> How do I specify email address for remote_smtp2?
You can't easily. You would be better off making *.ourdomain.com a local
domain and processing this with a director rather than a router. Then
you could use a smartuser director to change the name.
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.