浏览代码

* 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 24 年之前
父节点
当前提交
f573a76c8a
共有 1 个文件被更改,包括 8 次插入0 次删除
  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;
    }