alecpl
2008-08-28 79aeb308cb195dcc48004851795e811cee6f8ca1
- Write to log also sent MDN confirmation messages


3 files modified
27 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 15 ●●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 11 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -5,6 +5,7 @@
----------
- Added options to use syslog instead of log file (#1484850)
- Added Logging & Debugging section in Installer
- Write to smtp log also sent MDN confirmations
2008/08/26 (alec)
----------
program/steps/mail/func.inc
@@ -1076,7 +1076,7 @@
  $msg_body = $message->get();
  $headers = $message->headers();
  // send thru SMTP server using custom SMTP library
  if ($CONFIG['smtp_server'])
    {
@@ -1122,8 +1122,19 @@
      $sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str, "-f$from");
    }
  
  if ($sent)  // remove MDN headers after sending
  if ($sent)
  {
    // remove MDN headers after sending
    unset($headers['Return-Receipt-To'], $headers['Disposition-Notification-To']);
    if ($CONFIG['smtp_log'])
      write_log('sendmail', sprintf("[%s] User: %d on %s; Message for %s; %s",
        date("d-M-Y H:i:s O", mktime()),
        $_SESSION['user_id'],
        $_SERVER['REMOTE_ADDR'],
        $mailto,
        !empty($smtp_response) ? join('; ', $smtp_response) : ''));
  }
  
  $message->_headers = array();
  $message->headers($headers);
program/steps/mail/sendmail.inc
@@ -418,17 +418,6 @@
  }
else
  {
  if ($CONFIG['smtp_log'])
    {
    write_log('sendmail', sprintf(
      "[%s] User: %d on %s; Message for %s; %s\n",
      date("d-M-Y H:i:s O", mktime()),
      $_SESSION['user_id'],
      $_SERVER['REMOTE_ADDR'],
      $mailto,
      !empty($smtp_response) ? join('; ', $smtp_response) : ''));
    }
  rcmail_compose_cleanup();
  if ($store_folder && !$saved)