From f3dc9c6217d3b771a8a7030151f219397f71f155 Mon Sep 17 00:00:00 2001 From: tokul Date: Mon, 31 Jul 2006 16:43:56 +0000 Subject: [PATCH] added safety checks for outdated config.php and 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 | 8 ++++++++ src/read_body.php | 14 +++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/compose.php b/src/compose.php index 2d058d09..f0e7a10e 100644 --- a/src/compose.php +++ b/src/compose.php @@ -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) { diff --git a/src/read_body.php b/src/read_body.php index 22695d61..e8a74a15 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -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"); -- 2.25.1