Преглед изворни кода

Some minro modification to the use of config.php

gustavf пре 25 година
родитељ
комит
138c05236b
3 измењених фајлова са 15 додато и 13 уклоњено
  1. 4 4
      config/config.php
  2. 10 8
      functions/smtp.php
  3. 1 1
      src/compose_send.php

+ 4 - 4
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 <A HREF=\"mailto:squirrelmail-list@sourceforge.net\">mailing list</A>";

+ 10 - 8
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);

+ 1 - 1
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 "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=right_main.php\">";