Fixed return address of MDN receipts when having multiple identities (patch #530139)
authorteepe <teepe@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Apr 2002 15:23:56 +0000 (15:23 +0000)
committerteepe <teepe@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Apr 2002 15:23:56 +0000 (15:23 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2722 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/smtp.php

index 1b4e683bad3fde4aff44cc8684f527173d5d9e5e..f6f1e70e08bee3262b22d72b0175fd3bd81139bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,8 @@ Version 1.2.6 -- CVS
   - Fixed small bug in handeling timezone (bug #536149)        
   - MDN message now RFC compatible (bug #537662)
   - Fixed html tables in printer_friendly_bottom.php (patch #542367)
+  - Fixed return address of MDN receipts when having multiple identities
+    (patch #530139)
        
 Version 1.2.5 -- 22 February 2002
 ---------------------------------
index 00f3bceebf8fb7a3a1a76c8e43089569a496aeff..b553a62d641c1d9b661dec5076398407a7dddbdd 100644 (file)
@@ -912,11 +912,19 @@ function createPriorityHeaders($prio) {
 
 function createReceiptHeaders($receipt) {
 
-    GLOBAL $data_dir, $username;
+    GLOBAL $data_dir, $username, $identity;
 
     $receipt_headers = Array();
-    $from_addr = getPref($data_dir, $username, 'email_address');
-    $from = getPref($data_dir, $username, 'full_name');
+    if (isset($identity) && $identity != 'default') {
+        $from = getPref($data_dir, $username, 'full_name' . $identity);
+        $from_addr = getPref($data_dir, $username, 'email_address' . $identity);
+    } else {
+        $from = getPref($data_dir, $username, 'full_name');
+        $from_addr = getPref($data_dir, $username, 'email_address');
+    }
+    if ($from_addr == '') {
+        $from_addr = $popuser.'@'.$domain;
+    }
 
     if ($from == '') {
         $from = "<$from_addr>";