From 36fa79c8b54d32fc1807e88db260abab6e3814cb Mon Sep 17 00:00:00 2001 From: gustavf Date: Tue, 25 Jan 2000 14:47:26 +0000 Subject: [PATCH] Some minro modification to the use of config.php git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@178 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/config.php | 8 ++++---- functions/smtp.php | 18 ++++++++++-------- src/compose_send.php | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/config/config.php b/config/config.php index ec35eca2..b9173674 100644 --- a/config/config.php +++ b/config/config.php @@ -10,14 +10,14 @@ $org_title = "SquirrelMail $version"; // The server that your imap server is on - $imapServerAddress = "adam"; + $imapServerAddress = "localhost"; $imapPort = 143; // The domain where your email address is. // Example: in "luke@usa.om.org", usa.om.org is the domain. // this is for all the messages sent out. Reply address // is generated by $username@$domain - $domain = "usa.om.org"; + $domain = "initio.no"; // Your SMTP server and port number (usually the same as the IMAP server) $smtpServerAddress = "adam"; @@ -25,8 +25,8 @@ // Uncomment this if you want to deliver locally using sendmail instead // of connecting to a SMTP-server -// $useSendmail = true; -// $sendmail_path = "/usr/sbin/sendmail"; + $useSendmail = true; + $sendmail_path = "/usr/sbin/sendmail"; // This is displayed right after they log in $motd = "You are using SquirrelMail's web-based email client. If you run into any bugs or have suggestions, please report them to our mailing list"; diff --git a/functions/smtp.php b/functions/smtp.php index 2034191d..fbe4f707 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -2,23 +2,23 @@ /** smtp.php ** ** This contains all the functions needed to send messages through - ** an smtp server. + ** an smtp server or sendmail. **/ - function sendMessage($username, $domain, $t, $c, $b, $subject, $body, $version) { - include("../config/config.php"); + function sendMessage($t, $c, $b, $subject, $body, $version) { + global $useSendmail; if ($useSendmail==true) { - sendSendmail($username, $domain, $t, $c, $b, $subject, $body, $version); + sendSendmail($t, $c, $b, $subject, $body, $version); } else { - sendSMTP($username, $domain, $t, $c, $b, $subject, $body, $version); + sendSMTP($t, $c, $b, $subject, $body, $version); } } // Send mail using the sendmail command - function sendSendmail($username, $domain, $t, $c, $b, $subject, $body, $version) { - include("../config/config.php"); + function sendSendmail($t, $c, $b, $subject, $body, $version) { + global $username, $domain, $data_dir, $sendmail_path; // This is pretty much equal to the code in sendSMTP $to = parseAddrs($t); @@ -72,7 +72,9 @@ } } - function sendSMTP($username, $domain, $t, $c, $b, $subject, $body, $version) { + function sendSMTP($t, $c, $b, $subject, $body, $version) { + global $username, $domain; + include("../config/config.php"); $to = parseAddrs($t); diff --git a/src/compose_send.php b/src/compose_send.php index 1890d792..50bd68b4 100644 --- a/src/compose_send.php +++ b/src/compose_send.php @@ -52,7 +52,7 @@ $passed_bcc = stripslashes($passed_bcc); $passed_subject = stripslashes($passed_subject); - sendMessage($username, $domain, $passed_to, $passed_cc, $passed_bcc, $passed_subject, $passed_body, $version); + sendMessage($passed_to, $passed_cc, $passed_bcc, $passed_subject, $passed_body, $version); if ($auto_forward == true) echo ""; -- 2.25.1