summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-07-29 08:12:44 +0000
committeralecpl <alec@alec.pl>2010-07-29 08:12:44 +0000
commitdb1f1e31ca60658d605b7a60c7d43a3e37aa8923 (patch)
tree676867c9883f4cfed39b261c93bf4c7014b0b738 /program/steps
parent8fc8101c917d6857ccc5524923740f0afc990b0c (diff)
- Include all recipients in sendmail log
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/func.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 9d6d96dfb..a1cc68d16 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1444,6 +1444,14 @@ function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error, &$body_
// remove MDN headers after sending
unset($headers['Return-Receipt-To'], $headers['Disposition-Notification-To']);
+ // get all recipients
+ if ($headers['Cc'])
+ $mailto .= $headers['Cc'];
+ if ($headers['Bcc'])
+ $mailto .= $headers['Bcc'];
+ if (preg_match_all('/<([^@]+@[^>]+)>/', $mailto, $m))
+ $mailto = implode(', ', array_unique($m[1]));
+
if ($CONFIG['smtp_log']) {
write_log('sendmail', sprintf("User %s [%s]; Message for %s; %s",
$RCMAIL->user->get_username(),