Uses the brand new configuration directive email_address to set the
authorgustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Feb 2000 14:49:16 +0000 (14:49 +0000)
committergustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Feb 2000 14:49:16 +0000 (14:49 +0000)
From: address when sending mail.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@254 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/smtp.php

index fde15fa..9859c7e 100644 (file)
       $to = parseAddrs($t);
       $cc = parseAddrs($c);
       $bcc = parseAddrs($b);
-      $from_addr = "$username@$domain";
       $reply_to = getPref($data_dir, $username, "reply_to");
       $from = getPref($data_dir, $username, "full_name");
+      $from_addr = getPref($data_dir, $username, "email_address");
+
+      if ($from_addr == "")
+         $from_addr = "$username@$domain";
 
       $to_list = getLineOfAddrs($to);
       $cc_list = getLineOfAddrs($cc);
    }
 
    function sendSMTP($t, $c, $b, $subject, $body) {
-      global $username, $domain, $version, $smtpServerAddress, $smtpPort;
+      global $username, $domain, $version, $smtpServerAddress, $smtpPort,
+         $data_dir;
 
       $to = parseAddrs($t);
       $cc = parseAddrs($c);
       $bcc = parseAddrs($b);
-      $from_addr = "$username@$domain";
+      $from_addr = getPref($data_dir, $username, "email_address");
+
+      if ($from_addr == "")
+         $from_addr = "$username@$domain";
 
       $smtpConnection = fsockopen($smtpServerAddress, $smtpPort, $errorNumber, $errorString);
       if (!$smtpConnection) {