Pick up identities if you're not using default identity on resuming on draft.
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 11 Dec 2003 06:31:04 +0000 (06:31 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 11 Dec 2003 06:31:04 +0000 (06:31 +0000)
Looks like somebody had started, but left debugging code everywhere.

Please check commits to ensure there is no debug code ;)

This is the start of the work for bug #858001

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6265 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index 2bdacca4b167a895b9d4c20a3c9134987740d865..1c2f1b8dee3129377a102d9fb270c15b93c86cbd 100644 (file)
@@ -680,15 +680,24 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             $send_to = decodeHeader($orig_header->getAddr_s('to'),false,true);
             $send_to_cc = decodeHeader($orig_header->getAddr_s('cc'),false,true);
             $send_to_bcc = decodeHeader($orig_header->getAddr_s('bcc'),false,true);
+            $send_from = $orig_header->getAddr_s('from');
+            $send_from_parts = new AddressStructure();
+            $send_from_parts = $orig_header->parseAddress($send_from);
+            $send_from_add = $send_from_parts->mailbox . '@' . $send_from_parts->host;
+            $identities = get_identities();
+            if (count($identities) > 0) {
+                foreach($identities as $iddata) {
+                    if ($send_from_add == $iddata['email_address']) {
+                        $identity = $iddata['index'];
+                        break;
+                    }
+                }
+            }
             $subject = decodeHeader($orig_header->subject,false,true);
 //            /* remember the references and in-reply-to headers in case of an reply */
             $composeMessage->rfc822_header->more_headers['References'] = $orig_header->references;
             $composeMessage->rfc822_header->more_headers['In-Reply-To'] = $orig_header->in_reply_to;
             $body_ary = explode("\n", $body);
-/*        echo "debug: $identity"; #845290
-          $identity='2'; */
-            echo "header".decodeHeader($orig_header->getAddr_s('from'),false,true)."<BR>";
-           print_r($identities);
             $cnt = count($body_ary) ;
             $body = '';
             for ($i=0; $i < $cnt; $i++) {