Customize log message of postfix proxy?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Customize log message of postfix proxy?

Tobi
Hi

I use a pre-queue content filter via postfix proxy feature. Works fine :-)
My "problem" is the logmessage that is generated into maillog upon
reject of this pre-queue filter which currently looks like this:

Oct 24 09:48:29 myhost postfix/smtpd[16393]: proxy-reject:
END-OF-MESSAGE: 550 test.exe: Dangerous attachment type (Microsoft
kbid=883260); from=<REDACTED> to=<REDACTED> proto=ESMTP
helo=<host-013-100.aorta>

What I'm missing here is the ip address of the sending client which
triggered that reject. Is it somehow possible to add this information to
the logs via configuration of postfix?

The only other places in my logs where I see the client IP are those lines

Oct 24 09:48:28 myhost postfix/smtpd[16393]: connect from unknown[REDACTED]
Oct 24 09:48:29 myhost postfix/smtpd[16393]: disconnect from
unknown[REDACTED]
Oct 24 09:48:29 myhost postfix/smtpd[16393]: NOQUEUE:
client=unknown[REDACTED], sasl_method=LOGIN, sasl_username=REDACTED

but I can see no way to correlate these messages with the proxy-reject
message. As I guess that the same smtpd PID is used for several
mailtransactions?

Thanks for any idea

tobi
Reply | Threaded
Open this post in threaded view
|

Re: Customize log message of postfix proxy?

Viktor Dukhovni


> On Oct 24, 2017, at 4:03 AM, Tobi <[hidden email]> wrote:
>
> The only other places in my logs where I see the client IP are those lines
>
> Oct 24 09:48:28 myhost postfix/smtpd[16393]: connect from unknown[REDACTED]
> Oct 24 09:48:29 myhost postfix/smtpd[16393]: disconnect from
> unknown[REDACTED]
> Oct 24 09:48:29 myhost postfix/smtpd[16393]: NOQUEUE:
> client=unknown[REDACTED], sasl_method=LOGIN, sasl_username=REDACTED
>
> but I can see no way to correlate these messages with the proxy-reject
> message. As I guess that the same smtpd PID is used for several
> mailtransactions?

https://github.com/vdukhovni/postfix/tree/master/postfix/auxiliary/collate

--
        Viktor.