summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-09 11:25:53 +0100
committerAleksander Machniak <alec@alec.pl>2015-01-09 11:25:53 +0100
commitf6502176f894940aa95c634510dabb2591d1eeb0 (patch)
tree7f75990cd7bbd5ebbe04974e6806eeb3f2481161 /program/steps
parent9e26034801fe505a481d474e06bfc806cd548598 (diff)
Hide MDN and DSN options in compose if disabled by admin (#1490221)
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/compose.inc11
-rw-r--r--program/steps/mail/sendmail.inc14
2 files changed, 14 insertions, 11 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 92296e525..20a27ecb0 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -419,7 +419,8 @@ $OUTPUT->add_handlers(array(
'filedroparea' => 'compose_file_drop_area',
'priorityselector' => 'rcmail_priority_selector',
'editorselector' => 'rcmail_editor_selector',
- 'receiptcheckbox' => 'rcmail_receipt_checkbox',
+ 'receiptcheckbox' => 'rcmail_mdn_checkbox', // deprecated
+ 'mdncheckbox' => 'rcmail_mdn_checkbox',
'dsncheckbox' => 'rcmail_dsn_checkbox',
'storetarget' => 'rcmail_store_target_selection',
'addressbooks' => 'rcmail_addressbook_list',
@@ -1642,7 +1643,7 @@ function rcmail_priority_selector($attrib)
}
-function rcmail_receipt_checkbox($attrib)
+function rcmail_mdn_checkbox($attrib)
{
global $RCMAIL, $MESSAGE, $compose_mode;
@@ -1652,13 +1653,13 @@ function rcmail_receipt_checkbox($attrib)
if (!isset($attrib['id']))
$attrib['id'] = 'receipt';
- $attrib['name'] = '_receipt';
+ $attrib['name'] = '_mdn';
$attrib['value'] = '1';
$checkbox = new html_checkbox($attrib);
- if (isset($_POST['_receipt']))
- $mdn_default = $_POST['_receipt'];
+ if (isset($_POST['_mdn']))
+ $mdn_default = $_POST['_mdn'];
else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT)))
$mdn_default = (bool) $MESSAGE->headers->mdn_to;
else
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index c55e40064..4ad43e433 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -144,7 +144,7 @@ if ($RCMAIL->config->get('http_received_header')) {
$http_header .= $nldlm . ' via ';
}
- $host = $_SERVER['REMOTE_ADDR'];
+ $host = $_SERVER['REMOTE_ADDR'];
$hostname = gethostbyaddr($host);
if ($encrypt) {
@@ -171,7 +171,7 @@ if ($RCMAIL->config->get('http_received_header')) {
$headers['Date'] = $RCMAIL->user_date();
$headers['From'] = rcube_charset::convert($from_string, RCUBE_CHARSET, $message_charset);
-$headers['To'] = $mailto;
+$headers['To'] = $mailto;
// additional recipients
if (!empty($mailcc)) {
@@ -188,6 +188,10 @@ if (($max_recipients = (int) $RCMAIL->config->get('max_recipients')) > 0) {
}
}
+$dont_override = (array) $RCMAIL->config->get('dont_override');
+$mdn_enabled = in_array('mdn_default', $dont_override) ? $RCMAIL->config->get('mdn_default') : !empty($_POST['_mdn']);
+$dsn_enabled = in_array('dsn_default', $dont_override) ? $RCMAIL->config->get('dsn_default') : !empty($_POST['_dsn']);
+
// add subject
$headers['Subject'] = trim(rcube_utils::get_input_value('_subject', rcube_utils::INPUT_POST, TRUE, $message_charset));
@@ -228,7 +232,7 @@ if (!empty($_POST['_priority'])) {
}
}
-if (!empty($_POST['_receipt'])) {
+if ($mdn_enabled) {
$headers['Return-Receipt-To'] = $from_string;
$headers['Disposition-Notification-To'] = $from_string;
}
@@ -520,9 +524,7 @@ if (!$savedraft) {
}
// Handle Delivery Status Notification request
- if (!empty($_POST['_dsn'])) {
- $smtp_opts['dsn'] = true;
- }
+ $smtp_opts['dsn'] = $dsn_enabled;
$sent = $RCMAIL->deliver_message($MAIL_MIME, $from, $mailto,
$smtp_error, $mailbody_file, $smtp_opts);