On Wed, Oct 03, 2012 at 04:53:22PM +0200, Steffen Schebesta wrote:

> I deliver mails to my Postfix through smtpd. Postfix then takes it and sends
> it out to the recipient.

One or more recipients. And it may receive one or more copies of
the original message if it was sent to many recipients.

> Now I'm trying to change the queue_id for each email in Postfix 2.9 source
> code so that it is equal to the Message-ID (it is unique, don't worry) that

You can't do that. There is no guarantee that each mail transaction
(sender, recipients, message-content) has a unique message-id (part
of the message-content) since multi-recipient messages may be split
into multiple transactions in transit.

> I set in the email header when passing the email to Postfix through smtpd.
> I've looked in the source code for hours but cannot find the first time
> queue_id is set.

You can stop looking. What you're trying to do is not viable. There
are existing ways to message tracking via log parsing and success
DSNs if you want to aumate tracking of outbound mail.

Recent Postfix releases support non-recurring long queue-ids, they
are not going to be equal to the message-id, but that's fine.

-- 
        Viktor.

Reply via email to