Re: common format for maillog lines?

2020-10-08 Thread ml+opensmtpd_misc
On Thu, Oct 08, 2020, Harald Dunkel wrote:

> Lines with a message id, and lines without. Very painful.

Maybe that's because there are sessions and transactions in SMTP.
Only the latter belong to a specific message, the former can
contain multiple transactions, so logging a specific message id
for them is somehow wrong (unless you restrict the MTA to
perform only one transaction per session).

PS: some MTAs have/log ids specific to each part of the protocol:
session, transaction, recipient (and even specific to the server
and client side if needed).



common format for maillog lines?

2020-10-08 Thread Harald Dunkel

Hi folks,

apparently there are 2 different kinds of lines in /var/log/maillog:
Lines with a message id, and lines without. Very painful.

The lines without message id seem to start with "smtp-out:", eg

smtp-out: No valid route for 
[connector:10.125.142.10->[relay:example.com,smtp,sourcetable=,heloname=mail.example.de],0x0]

Do you think it would be possible to clean this up? I would like to
grep for the message ID to get the *whole* set of log file lines
related to this message, and to ignore the unrelated smtp-out lines.


Thanx in advance
Harri