Re: [exim] [exim-dev] Logging address ip of outgoing mail

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Marcin Mirosław
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] [exim-dev] Logging address ip of outgoing mail
W dniu 04.02.2011 00:05, Jeremy Harris pisze:
> I'm not aware of a log_selector that does what you want.


I'm not programmer, i don't know if exim is able to know outgoing
address when "interface =" isn't used. If it's possible could i make
feature request?

> What I've done to help logging in routing/transport is an
> embedded-perl function Exim::log_write called as a dummy
> lookup. Typically I use this in a router as:
>
>     data =      ${if eq {}{\
>               ${perl{Exim::log_write}{router_name: bad  <$local_part@$domain>}}}\
>                    {}{}}

>
> I assume you're using an smtp transport with a lookup for
>     interface =
> and you could do something similar there.


You've guessed perfectly:) I didn't mention it, my fault.
There is great option "log_message" for acl, i'm missing it.
I can't use "data=" in dnslookup router so i tried to change it to
"condition=", and condition is always true.
I've read i sholud use "perl_startup", but there is no external perl
script needed. So i created empty, fake file, and provided it to
startup_perl. Is it correct way?
Finally, i have this line in router:
condition = ${if eq {}{${perl{Exim::log_write}{adres_wych:
${lookup{$domain}wildlsearch{/etc/exim/domeny_interfejs.txt}{$value}{}}
}}}{1}{1}}

which do what i want.
Thank you for hint!

P.S.1 This solution has small disadvantage, if destination domain is
ipv6 capable, in log appears address ipv4. This is not real problem,
because i've got only one ipv6 interface, so if destination is like
[2000::....], i know, that those line isn't correct.
P.S.2 I sent email to exim-dev accidentally but there is no option to
cancel email

Regards,
Marcin