Is there any way to configure the mail logging such that it outputs a common identifier, such as perhaps the contents of Message-ID header field?
The Message-ID: header is completely meaningless. Very often different messages have the same exact Message-ID: header.
The only thing you can count on is the id= field in the mail logs. Such as:
Aug 3 01:35:03 ny courierd: newmsg,id=000C3016.3F2C9F07.000056F2: unknown; uucp (brimstone!uucp)
Each message will have a unique id field (and a give message may have multiple recipients). Extracting everything in the mail logs that carry the same id= field will tell you everything that happened to the message.
The first entry for a given message will always be "newmsg,id=".
The last entry for a given message will always be "completed,id=", indicating that all recipients have been delivered to (a failure is still considered as a completed delivery, albeit one that resulted in a failure), and may be logged as much as a week later.
Everything in the meantime will be logged. Every delivery attempt, every recipient, every outcome.
pgp00000.pgp
Description: PGP signature
