Hi, Postfix List

I would like to build the script which analyze maillog and produce a
report of every email delivery. My server currently act as relay
server between internal mail server and Internet. My final purpose,
when I query a sender and/or recipient, I will know if the rejection
occurs or not.

As far as I know, the rejection would triggered in smtpd and cleanup.
When analyze rejection on smtpd, we have no problem because the
postfix will record sender and every recipient. But when header_checks
and body_checks kicks in via cleanup daemon, the log just shows queue
id, sender and *last recipient*. So if the message contains multiple
recipient, I will not able to tracking every rejected recipient.

To help understanding my problem, here the demo

SMTP TRANSACTION:
#telnet mx 25
Trying 192.168.117.135...
Connected to mx.domain.org.
Escape character is '^]'.
220  ESMTP
MAIL FROM:<f...@server.domain.org>
250 2.1.0 Ok
RCPT TO:<us...@mx.domain.org>
250 2.1.5 Ok
RCPT TO:<us...@mx.domain.org>
250 2.1.5 Ok
RCPT TO:<us...@mx.domain.org>
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
x-header: momomo
test
data
.
550 5.7.1 GET OUT

MAILLOG in postfix server
May 16 17:30:14 mx postfix/smtpd[1308]: connect from
server.domain.org[192.168.117.143]
May 16 17:30:40 mx postfix/smtpd[1308]: 30EBB38A:
client=server.domain.org[192.168.117.143]
May 16 17:31:21 mx postfix/cleanup[1312]: 30EBB38A: reject: header
x-header: momomo from server.domain.org[192.168.117.143];
from=<f...@server.domain.org> to=<us...@mx.domain.org> proto=SMTP:
5.7.1 GET OUT
May 16 17:34:59 mx postfix/smtpd[1308]: disconnect from
server.domain.org[192.168.117.143]

So, I expected that postfix keep logging that 3 recipient (user1,
user2, user3) was rejected, not just user3. Can I achieved that? Or
there is a other way?
Thanks a lot for your answer

==MasEGALoeH

Reply via email to