added safety checks for outdated config.php and
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2006 16:43:56 +0000 (16:43 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2006 16:43:56 +0000 (16:43 +0000)
updated sendMDN code to newer sendmail delivery class

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

src/compose.php
src/read_body.php

index 2d058d0927f9ab2ea9c1b1d87351e289d2c3625b..f0e7a10e1f90900af6a49087f0a330d84bff1cf2 100644 (file)
@@ -1624,6 +1624,14 @@ function deliverMessage($composeMessage, $draft=false) {
     } elseif (!$draft) {
         require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
         global $sendmail_path, $sendmail_args;
+        // Check for outdated configuration
+        if (!isset($sendmail_args)) {
+            if ($sendmail_path=='/var/qmail/bin/qmail-inject') {
+                $sendmail_args = '';
+            } else {
+                $sendmail_args = '-i -t';
+            }
+        }
         $deliver = new Deliver_SendMail(array('sendmail_args'=>$sendmail_args));
         $stream = $deliver->initStream($composeMessage,$sendmail_path);
     } elseif ($draft) {
index 22695d615b4024a3f8b71f26f1bfa6a4e9fb6581..e8a74a1582504c83f219a2ba4887fe1b76d9e885 100644 (file)
@@ -294,8 +294,16 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
 
     if ($useSendmail) {
         require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
-        global $sendmail_path;
-        $deliver = new Deliver_SendMail();
+        global $sendmail_path, $sendmail_args;
+        // Check for outdated configuration
+        if (!isset($sendmail_args)) {
+            if ($sendmail_path=='/var/qmail/bin/qmail-inject') {
+                $sendmail_args = '';
+            } else {
+                $sendmail_args = '-i -t';
+            }
+        }
+        $deliver = new Deliver_SendMail(array('sendmail_args'=>$sendmail_args));
         $stream = $deliver->initStream($composeMessage,$sendmail_path);
     } else {
         require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
@@ -771,7 +779,7 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
 
     /* Output the download and/or unsafe images link/-s, if any. */
     if ($download_and_unsafe_link) {
-       echo $download_and_unsafe_link;
+        echo $download_and_unsafe_link;
     }
 
     do_hook("read_body_header_right");