[Mimedefang] Get the default of a missing MessageID from sendmail

Damrose, Mark mdamrose at elgin.edu
Tue May 6 11:13:29 EDT 2008

> -----Original Message-----
> From: Steffen Kaiser

> is there a way to acquire the default (self-created) one of a missing
> Message-ID from sendmail?

I believe that it isn't generated by sendmail until after MD runs.

> I want to sync some logs between MIMEDefang processing and later ones,
> but
> have to use the message ID. When I generate a message without message
> ID,
> sendmail logs:
> from=<>, size=20, class=0, nrcpts=1,
> msgid=<200805061425.m46EOAW2022602@$hostname>,
> but $MessageID in MIMEDefang is 'NOQUEUE', unfortunatly. I have found
> two
> workarounds, so it's not that problematic, 

The Queue ID will be there, so it should be pretty easy to use that
unless you are comparing it to another system.  In that case a two step
process of pulling all the records with the same Queue ID and looking
for sendmail to add the message ID on the way out should be doable.

> but it would be cleaner, if
> MIMEDefang could log the outgoing message ID without to generate a new
> one, which probably differs from sendmail's one.

MD has a built-in function called gen_msgid_header.  It concatenates the
current time, Queue ID, and hostname so is close to what sendmail would
do, but may be a fraction of a second off.  That's probably not close
enough for what you want.

More information about the MIMEDefang mailing list