Browse Source

Guarantee outgoing addresses have a domain part

pdontthink 17 years ago
parent
commit
329525803a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      functions/identity.php

+ 5 - 0
functions/identity.php

@@ -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);