Discussion:
Positive DSN if delay_warning_time is reached?
(too old to reply)
Florian Pritz
2014-08-18 09:50:18 UTC
Permalink
Hi,

I've currently set delay_warning_time = 4h and maximal_queue_lifetime =
5d, which are nice values and all, but if I get a delay DSN I'd like to
know sooner than after 5 days if the mail went through.

I can't seem to find an option that sends me a positive DSN for delayed
mail, is there one? If not, is this something you'd consider implementing?

Thanks,
Florian
Wietse Venema
2014-08-18 11:12:21 UTC
Permalink
Post by Florian Pritz
I've currently set delay_warning_time = 4h and maximal_queue_lifetime =
5d, which are nice values and all, but if I get a delay DSN I'd like to
know sooner than after 5 days if the mail went through.
By default, Postfix requests a DSN for delayed and failed mail.

To request a DSN when mail is DELIVERED:

UNIX command line:

sendmail -N 'delay,failure,success'

SMTP protocol:

RCPT TO:<address> NOTIFY=DELAY,FAILURE,SUCCESS

After doing the above, you can trigger "success" notification when
mail leaves your network:

/etc/postfix/main.cf:
smtp_discard_ehlo_keywords = dsn

If you read this far, then you will inderstand that there will be
no separate option to request a DSN when mail leaves your network,
because the above features already provide this function.

References:
http://www.postfix.org/DSN_README.html
RFC 3461 (SMTP DSN Extension)
RFC 3462 (Delivery Status Notifications)
RFC 6533 (Internationalized Delivery Status Notifications)

Wietse
Florian Pritz
2014-08-18 12:12:29 UTC
Permalink
Post by Wietse Venema
Post by Florian Pritz
I've currently set delay_warning_time = 4h and maximal_queue_lifetime =
5d, which are nice values and all, but if I get a delay DSN I'd like to
know sooner than after 5 days if the mail went through.
If you read this far, then you will inderstand that there will be
no separate option to request a DSN when mail leaves your network,
because the above features already provide this function.
Thanks for the explanation, but I already know you can request a success
DSN when sending email. My questions is different in that I only want a
success DSN if the mail has previously generated a delay DSN and I don't
want success DSNs all the time. Basically I want a "your mail is no
longer being delayed and has been delivered to the next hop" DSN.

This doesn't seem to be covered by the RFCs so I understand if this is
not possible, although I'd consider it a useful feature.
Wietse Venema
2014-08-18 12:58:18 UTC
Permalink
Post by Florian Pritz
Post by Wietse Venema
Post by Florian Pritz
I've currently set delay_warning_time = 4h and maximal_queue_lifetime =
5d, which are nice values and all, but if I get a delay DSN I'd like to
know sooner than after 5 days if the mail went through.
If you read this far, then you will inderstand that there will be
no separate option to request a DSN when mail leaves your network,
because the above features already provide this function.
Thanks for the explanation, but I already know you can request a success
DSN when sending email. My questions is different in that I only want a
I can assure you that I have no difficulties comprehending this
difference, so there is no need to repeat your explanation.

Wietse
LuKreme
2014-08-18 20:33:34 UTC
Permalink
Post by Florian Pritz
Thanks for the explanation, but I already know you can request a success
DSN when sending email. My questions is different in that I only want a
success DSN if the mail has previously generated a delay DSN and I don't
want success DSNs all the time. Basically I want a "your mail is no
longer being delayed and has been delivered to the next hop" DSN.
Should be something that you can do yourself. Keep a table of the messages that have generated a delay DSN, check success DNS messages against it, and chuck out the ones that don’t match.

Also, assuming you get time stamps in the DSNs, you could pre-filter by chucking out anything that is less than a minute/hour/day old, as suits your needs.
--
"It was a dark and stormy night; the rain fell in torrents -- except at
occasional intervals, when it was checked by a violent gust of wind
which swept up the streets (for it is in London that our scene lies)
rattling along the housetops, and fiercely agitating the scanty flame of
the lamps that struggled against the darkness."
Wietse Venema
2014-08-29 00:01:37 UTC
Permalink
Post by Florian Pritz
Hi,
I've currently set delay_warning_time = 4h and maximal_queue_lifetime =
5d, which are nice values and all, but if I get a delay DSN I'd like to
know sooner than after 5 days if the mail went through.
I can't seem to find an option that sends me a positive DSN for delayed
mail, is there one? If not, is this something you'd consider implementing?
I think that this can be implemented without a significant amount
of code. Thus, it is likely to work correctly.

First, when the queue manager selects a message for delivery, it
needs to find out that a "delayed" DSN was sent for that message.
That is easy. Each Postfix queue file either contains no delay
warning record, or it contains a delay warning record with a time
value that says when to send a "delayed" warning. A zero time value
means that the "delayed" warning was already sent.

Once the queue manager sees that the "delayed" DSN was already sent,
it sets a new NOTIFY flag for all subsequent delivery attempts.
That new flag is almost like the standard NOTIFY=SUCCESS flag,
except that this flag is not sent to a remote SMTP server. Instead,
the Postfix SMTP client reports a "relayed" status. Other Postfix
delivery agents will treat this new flag as the standard NOTIFY=SUCCESS
flag, and report a "delivered" status.

Wietse

Loading...