/* RFC 2298 */
$header[] = 'Disposition-Notification-To: '.$dnt. $rn;
}
+ if ($rfc822_header->dsn) {
+ $dsn = $rfc822_header->getAddr_s('dsn');
+ $header[] = 'Return-Receipt-To: '.$dsn. $rn;
+ }
if ($rfc822_header->priority) {
switch($rfc822_header->priority)
{
*/
var $dnt = '';
/**
- * Delivery notification (DR)
+ * Address for requesting message delivery status notification (DSN)
* @var mixed
*/
- var $drnt = '';
+ var $dsn = '';
/**
* @var mixed
*/
break;
case 'return-receipt-to':
$value = $this->stripComments($value);
- $this->drnt = $this->parseAddress($value);
+ $this->dsn = $this->parseAddress($value);
break;
case 'mime-version':
$value = $this->stripComments($value);
// Remember the receipt settings
$request_mdn = $mdn_user_support && !empty($orig_header->dnt) ? '1' : '0';
- $request_dr = $mdn_user_support && !empty($orig_header->drnt) ? '1' : '0';
+ $request_dr = $mdn_user_support && !empty($orig_header->dsn) ? '1' : '0';
/* remember the references and in-reply-to headers in case of an reply */
//FIXME: it would be better to fiddle with headers inside of the message object or possibly when delivering the message to its destination (drafts folder?); is this possible?
/* Receipt: On Delivery */
if (!empty($request_dr)) {
-//FIXME: it would be better to fiddle with headers inside of the message object or possibly when delivering the message to its destination; is this possible?
- $rfc822_header->more_headers['Return-Receipt-To'] = $from_addr;
- } elseif (isset($rfc822_header->more_headers['Return-Receipt-To'])) {
- unset($rfc822_header->more_headers['Return-Receipt-To']);
+ $rfc822_header->dsn = $rfc822_header->parseAddress($from_addr,true);
+ } elseif (isset($rfc822_header->dsn)) {
+ unset($rfc822_header->dsn);
}
/* multipart messages */
$content_type->properties['charset']=$default_charset;
}
$rfc822_header->content_type = $content_type;
- $rfc822_header->to[] = $header->dnt;
+ if (!empty($header->dnt))
+ $rfc822_header->to[] = $header->dnt;
+ else
+ $rfc822_header->to[] = $header->dsn;
$rfc822_header->subject = _("Read:") . ' ' . decodeHeader($header->subject,true,false);
$idents = get_identities();
if ($default_use_mdn) {
if ($mdn_user_support) {
- if ($header->dnt) {
+ // We are generous to the sender because DSNs are commonly ignored by servers and
+ // technically offering a return receipt in the MUA for a DSN is overstepping the RFCs
+ if ($header->dnt || $header->dnt) {
$mdn_url = $PHP_SELF;
$mdn_url = set_url_var($mdn_url, 'mailbox', urlencode($mailbox));
$mdn_url = set_url_var($mdn_url, 'passed_id', $passed_id);