Guarantee outgoing addresses have a domain part
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 9 Jul 2008 19:25:40 +0000 (19:25 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 9 Jul 2008 19:25:40 +0000 (19:25 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13224 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/identity.php

index 79576ab84807ee02b92cedf47990c858a6875256..4f80b0a4c790934627cad520255d4ef01d997af0 100644 (file)
@@ -225,6 +225,9 @@ function empty_identity($ident) {
  * @since 1.5.2
  */
 function build_from_header($identity = 0) {
+
+    global $domain;
+
     $idents = get_identities();
 
     if (! isset($idents[$identity]) ) $identity = 0;
@@ -234,6 +237,8 @@ function build_from_header($identity = 0) {
     }
 
     $from_mail = $idents[$identity]['email_address'];
+    if (strpos($from_mail, '@') === FALSE)
+        $from_mail .= '@' . $domain;
     
     if ( isset($from_name) ) {
         $from_name_encoded = encodeHeader($from_name);