On Tue, Nov 05, 2024 at 12:50:53AM +0100, Thomas Landauer via Postfix-users 
wrote:

> my use case: I want to find out if outgoing messages were delivered
> successfully, so I'm looking at the lines containing `status=` in the
> logfile.
>
> But I need this only for some mails (not all). To find out, I have to query
> the database for the Queue-ID. This step could be skipped if it would be
> possible to prefix something like `foo.` to the Queue-ID.

Why not request success/failure delivery status notifications, and give
each messages a unique ENVID.  Then you'll be notified of the success or
failure to deliver each message to the last hop that supports ESMTP DSN.

    https://datatracker.ietf.org/doc/html/rfc3461

With sendmail(1):

    sendmail -f <notified-envelope-sender> -V <unique-envid> -N success,failure 
-i -- <recipient> ... < msg

Over SMTP (provided the SMTP server includes DSN in its EHLO response):

    MAIL FROM:<notified-envelope-sender> ENVID=<unique-envid> RET=hdrs
    RCPT TO:<each-recipient> NOTIFY=success,failure
    ...

Either assume that you're not particularly interested in DELAY
notifications, but see the docs in any case.

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to