Is there any way to pass the postfix' queue id (not the Message-ID: header) to a procmail command?
The reason behind is to have a procmail logfile containing the queue id for detailed logging about a handled message.
Is there any way to pass the postfix' queue id (not the Message-ID: header) to a procmail command?
The reason behind is to have a procmail logfile containing the queue id for detailed logging about a handled message.
Procmail can extract anything you can articulate a regex for. Without access to your local headers, this is speculative and somewhat ad lib but hopefully it should at least give you an idea.
# Put a newline in a string for the log message
NL="
"
:0
* ^Received: from .* \
by yourserver\.example\.com \(Postfix)\
with [A-Z]+ id \/[A-F0-9]+
{ LOG="Postfix id $MATCH$NL" }
The special token \/
causes the matching text after it to be captured into the variable $MATCH
.