[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14944] branches/SM-1_4-STABLE/squirrelmail
From:       pdontthink--- via squirrelmail-cvs <squirrelmail-cvs () lists ! sourceforge ! net>
Date:       2022-04-13 20:08:40
Message-ID: 1649880520.414870.17499 () sfp-scm-7 ! v30 ! lw ! sourceforge ! com
[Download RAW message or body]

Revision: 14944
          http://sourceforge.net/p/squirrelmail/code/14944
Author:   pdontthink
Date:     2022-04-13 20:08:39 +0000 (Wed, 13 Apr 2022)
Log Message:
-----------
Separate DNT and DSN

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/class/deliver/Deliver.class.php
    branches/SM-1_4-STABLE/squirrelmail/class/mime/Rfc822Header.class.php
    branches/SM-1_4-STABLE/squirrelmail/src/compose.php
    branches/SM-1_4-STABLE/squirrelmail/src/read_body.php

Modified: branches/SM-1_4-STABLE/squirrelmail/class/deliver/Deliver.class.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/class/deliver/Deliver.class.php	2022-04-05 \
                02:12:15 UTC (rev 14943)
+++ branches/SM-1_4-STABLE/squirrelmail/class/deliver/Deliver.class.php	2022-04-13 \
20:08:39 UTC (rev 14944) @@ -739,6 +739,10 @@
             /* 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)
             {

Modified: branches/SM-1_4-STABLE/squirrelmail/class/mime/Rfc822Header.class.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/class/mime/Rfc822Header.class.php	2022-04-05 \
                02:12:15 UTC (rev 14943)
+++ branches/SM-1_4-STABLE/squirrelmail/class/mime/Rfc822Header.class.php	2022-04-13 \
20:08:39 UTC (rev 14944) @@ -122,6 +122,10 @@
     /**
      * @var mixed
      */
+    var $dsn = '';
+    /**
+     * @var mixed
+     */
     var $encoding = '';
     /**
      * @var mixed
@@ -266,11 +270,14 @@
                 $this->references = $value;
                 break;
             case 'x-confirm-reading-to':
-            case 'return-receipt-to':
             case 'disposition-notification-to':
                 $value = $this->stripComments($value);
                 $this->dnt = $this->parseAddress($value);
                 break;
+            case 'return-receipt-to':
+                $value = $this->stripComments($value);
+                $this->dsn = $this->parseAddress($value);
+                break;
             case 'mime-version':
                 $value = $this->stripComments($value);
                 $value = str_replace(' ', '', $value);

Modified: branches/SM-1_4-STABLE/squirrelmail/src/compose.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/compose.php	2022-04-05 02:12:15 UTC (rev \
                14943)
+++ branches/SM-1_4-STABLE/squirrelmail/src/compose.php	2022-04-13 20:08:39 UTC (rev \
14944) @@ -1726,7 +1726,7 @@
 
     /* Receipt: On Delivery */
     if (isset($request_dr) && $request_dr) {
-        $rfc822_header->more_headers['Return-Receipt-To'] = $from_mail;
+        $rfc822_header->dsn = $rfc822_header->parseAddress($from_mail,true);
     }
 
     /* multipart messages */

Modified: branches/SM-1_4-STABLE/squirrelmail/src/read_body.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/read_body.php	2022-04-05 02:12:15 UTC \
                (rev 14943)
+++ branches/SM-1_4-STABLE/squirrelmail/src/read_body.php	2022-04-13 20:08:39 UTC \
(rev 14944) @@ -184,7 +184,10 @@
         $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);  
     // FIXME: use identity.php from SM 1.5. Change this also in compose.php
@@ -465,7 +468,9 @@
     }
     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->dsn) {
                 if ($message->is_mdnsent) {
                     $env[_("Read receipt")] = _("sent");
                 } else {

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.



-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic