Use personal info of from address if reply-to address is missing it
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Feb 2010 20:09:32 +0000 (13:09 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Feb 2010 20:09:32 +0000 (13:09 -0700)
imp/lib/Compose.php

index 864b23e..85e1f21 100644 (file)
@@ -1389,7 +1389,17 @@ class IMP_Compose
                              * doesn't have a post address but does have a
                              * reply-to address. */
                             if ($val == 'reply-to') {
-                                $header['to'] = $addr_obs[0]['address'];
+                                /* If reply-to doesn't have personal
+                                 * information, check from address. */
+                                if (!$addr_obs[0]['personal'] &&
+                                    ($to_ob = $h->getOb('from')) &&
+                                    $to_ob[0]['personal'] &&
+                                    ($to_addr = Horde_Mime_Address::addrArray2String($to_ob)) &&
+                                    Horde_Mime_Address::bareAddress($to_addr) == $addr_obs[0]['address']) {
+                                    $header['to'] = $to_addr;
+                                } else {
+                                    $header['to'] = $addr_obs[0]['address'];
+                                }
                             } else {
                                 $cc_addrs = array_merge($cc_addrs, $addr_obs);
                             }