Explorar o código

* Since we do an address book lookup for nicknames, might as well add
@$domain at the end of an address if there is no '@' symbol anywhere

Tyler Akins %!s(int64=24) %!d(string=hai) anos
pai
achega
f573a76c8a
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      functions/smtp.php

+ 8 - 0
functions/smtp.php

@@ -39,7 +39,11 @@
 
    // looks up aliases in the addressbook and expands them to
    // the full address.
+   // Adds @$domain if it wasn't in the address book and if it
+   // doesn't have an @ symbol in it
    function expandAddrs ($array) {
+      global $domain;
+      
       $abook = addressbook_init();
       for ($i=0; $i < count($array); $i++) {
          $result = $abook->lookup($array[$i]);
@@ -55,6 +59,10 @@
 	 {
 	    $array[$i] = '<' . $array[$i] . '>';
 	 }
+	 
+	 if (strpos($array[$i], '@') === false) {
+	    $array[$i] .= '@' . $domain;
+	 }
       }
       return $array;
    }