Mailserver Log entries following through mailman?
Hi,
is there some way to find an ID to follow an email through mailman? In the exim logfile there is only something like C="250 Ok" (whereas in mails sent to another exim there is something like C="250 OK id=…"). (What I sometimes need to do is to follow an mail whether it is sent through mailman and to where.)
Or should I raise an issue as whishlist request?
Regards, Andi
On 11/10/23 12:39, Andreas Barth wrote:
is there some way to find an ID to follow an email through mailman? In the exim logfile there is only something like C="250 Ok" (whereas in mails sent to another exim there is something like C="250 OK id=…"). (What I sometimes need to do is to follow an mail whether it is sent through mailman and to where.)
Every message should have a unique Message-ID: header. According to my reading of https://www.exim.org/exim-html-current/doc/html/spec_html/ch-log_files.html Exim should create a => log entry with an id= field containing the Message-ID when the message is received for delivery to Mailman and another similar entry when the message is received from Mailman for delivery to one or more list members.
Mailman itself logs ACCEPT:, HOLD:, DISCARD:, REJECT: and OWNER: entries in mailman.log for those events (OWNER: indicates a message to list owners). All these entries contain the Message-ID.
Mailman's smtp.log contains 'post to' and 'smtp to' entries with Message-IDs for all outgoing messages.
Or should I raise an issue as whishlist request?
What exactly would you wish for that Mailman can do.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
- Mark Sapiro (mark@msapiro.net) [231110 23:54]:
On 11/10/23 12:39, Andreas Barth wrote:
is there some way to find an ID to follow an email through mailman? In the exim logfile there is only something like C="250 Ok" (whereas in mails sent to another exim there is something like C="250 OK id=…"). (What I sometimes need to do is to follow an mail whether it is sent through mailman and to where.)
Every message should have a unique Message-ID: header. According to my reading of https://www.exim.org/exim-html-current/doc/html/spec_html/ch-log_files.html Exim should create a => log entry with an id= field containing the Message-ID when the message is received for delivery to Mailman and another similar entry when the message is received from Mailman for delivery to one or more list members.
There is the message-id as part of the mail itself, and set by the user. That one is not unique, e.g. if a mail is bounced to the list. Exim has an internal id, and that is also part of the log (also if a mail is delivered to a remote mailserver, the id there is logged). This works fine.
However, mailman doesn't have an internal id I can use to follow the message (or at least, it doesn't transfer one to exim upon delivery).
I can indeed use the user set message id for following mail. However, I would prefer some internal id, and also to have logged the IDs exim (or probably any other MTA) transmits upon delivering the mails when handing the mails over to the MTA again. (Probably in some format as "mailman-ID recepient MTA-id" so that it's easy for me to grep for message if a user complains.)
Regards, Andi
Andreas Barth writes:
However, mailman doesn't have an internal id I can use to follow the message (or at least, it doesn't transfer one to exim upon delivery).
Mailman does have an internal ID for each LTMP transaction, which is the queue file name. That is generated by hashing the message, the current time and something else so that should be unique enough for your purpose. I guess we could log that, but I'm not sure how that would benefit you. Returning it in the LMTP status may be possible, but it's not currently exposed to the LMTP runner which manages that transaction.
I can indeed use the user set message id for following mail.
Then I don't see the problem. Identifying a particular message is what that is for. Unless you're getting a spew of repeats of a single message (which is certainly possible, but then I doubt that the problem you're solving is tracing a single instance of the spew!), that plus the timestamp should be enough to disambiguate most possible repeats.
However, I would prefer some internal id, and also to have logged the IDs exim (or probably any other MTA) transmits upon
I don't understand. MTAs don't explicitly transmit their internal IDs to the next hop; there's no provision for this in the SMTP (LMTP) protocol AFAICR. They can add it to their Received field, and they can log it themselves. In theory they can return it in the status message they pass back to the previous MTA upon acceptance, but I rarely recall seeing it done (Exchange does it, I think). And in any case this only works on your site, you're still going to have to fall back on some combination of message-id, author, and timestamp as goes from host to host.
Please be more specific about how IDs are transmitted at your site, and be careful that different mechanisms have to be used on receipt and forwarding.
delivering the mails when handing the mails over to the MTA again. (Probably in some format as "mailman-ID recepient MTA-id" so that it's easy for me to grep for message if a user complains.)
I guess we could do that for the outgoing MTA if it's present in the status message, but that's likely to be a lot of output unless all your subscribers are in the same domain. But there's no way to get it for the incoming MTA as far as I know, except maybe parsing it out of the Received chain.
Besides the dubious existence of the relevant data, the lack of support in the SMTP and LMTP protocol means that every MTA, and some exceptional instances of each MTA (I'm pretty sure both Postfix and Exim4 support customizable status messages) would have to be supported individually by parsing it out of the status return or the Received chain, neither of which is standardized. This sounds like a lot of work for us for each MTA in use on the Internet.
Steve
participants (3)
-
Andreas Barth
-
Mark Sapiro
-
Stephen J. Turnbull