summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-11-24 10:07:50 +0100
committerAleksander Machniak <alec@alec.pl>2013-11-24 10:07:50 +0100
commitf59cfe88063957a0d07a99b6893e5e2cd8598f53 (patch)
treecf53f9bb964f4f07b4cb531f572705b770b51ffb
parentf52efbd5cde3bdd7733d1318de06cce3386b62b2 (diff)
Make Reporting-UA header in MDN report optional, as User-Agent is
-rw-r--r--program/steps/mail/func.inc30
1 files changed, 15 insertions, 15 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 8164592dd..aefe1744c 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1705,33 +1705,33 @@ function rcmail_send_mdn($message, &$smtp_error)
'References' => trim($message->headers->references . ' ' . $message->headers->messageID),
);
- if ($agent = $RCMAIL->config->get('useragent'))
- $headers['User-Agent'] = $agent;
+ $report = "Final-Recipient: rfc822; {$identity['email']}\r\n" .
+ "Original-Message-ID: {$message->headers->messageID}\r\n" .
+ "Disposition: manual-action/MDN-sent-manually; displayed\r\n";
- if ($RCMAIL->config->get('mdn_use_from'))
- $options['mdn_use_from'] = true;
+ if ($message->headers->to) {
+ $report .= "Original-Recipient: {$message->headers->to}\r\n";
+ }
+
+ if ($agent = $RCMAIL->config->get('useragent')) {
+ $headers['User-Agent'] = $agent;
+ $report .= "Reporting-UA: $agent\r\n";
+ }
$body = rcube_label("yourmessage") . "\r\n\r\n" .
"\t" . rcube_label("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" .
"\t" . rcube_label("subject") . ': ' . $message->subject . "\r\n" .
"\t" . rcube_label("sent") . ': ' . format_date($message->headers->date, $RCMAIL->config->get('date_long')) . "\r\n" .
- "\r\n" . rcube_label("receiptnote") . "\r\n";
-
- $ua = $RCMAIL->config->get('useragent', "Roundcube Webmail (Version ".RCMAIL_VERSION.")");
- $report = "Reporting-UA: $ua\r\n";
-
- if ($message->headers->to)
- $report .= "Original-Recipient: {$message->headers->to}\r\n";
-
- $report .= "Final-Recipient: rfc822; {$identity['email']}\r\n" .
- "Original-Message-ID: {$message->headers->messageID}\r\n" .
- "Disposition: manual-action/MDN-sent-manually; displayed\r\n";
+ "\r\n" . rcube_label("receiptnote");
$compose->headers($headers);
$compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification'));
$compose->setTXTBody(rc_wordwrap($body, 75, "\r\n"));
$compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline');
+ if ($RCMAIL->config->get('mdn_use_from'))
+ $options['mdn_use_from'] = true;
+
$sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options);
if ($sent) {