diff options
author | alecpl <alec@alec.pl> | 2008-08-28 07:40:35 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-08-28 07:40:35 +0000 |
commit | 79aeb308cb195dcc48004851795e811cee6f8ca1 (patch) | |
tree | e8f5fae4c7a8f296aa203a10d591bfe9684e09ff /program/steps/mail | |
parent | 2e3ce3e76541aca33d42627bdb3b4e194410aae9 (diff) |
- Write to log also sent MDN confirmation messages
Diffstat (limited to 'program/steps/mail')
-rw-r--r-- | program/steps/mail/func.inc | 15 | ||||
-rw-r--r-- | program/steps/mail/sendmail.inc | 11 |
2 files changed, 13 insertions, 13 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index f578090f6..b1f359f63 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1076,7 +1076,7 @@ function rcmail_deliver_message(&$message, $from, $mailto) $msg_body = $message->get(); $headers = $message->headers(); - + // send thru SMTP server using custom SMTP library if ($CONFIG['smtp_server']) { @@ -1122,8 +1122,19 @@ function rcmail_deliver_message(&$message, $from, $mailto) $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); diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 25d95f949..301df52e7 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -418,17 +418,6 @@ if ($savedraft) } 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) |