From: Michael M Slusarz Date: Tue, 6 Apr 2010 19:15:45 +0000 (-0600) Subject: Add another level to disposition_send_mdn pref X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fa88ada98027ce5df5f3285f3e69cd575eca8eef;p=horde.git Add another level to disposition_send_mdn pref Given that many spam messages are sent requesting MDNs, it is probably best no to have MDNs sent out automatically by default. So add a "MDNs allowed, but prompt first", which will be the default. --- diff --git a/imp/config/prefs.php.dist b/imp/config/prefs.php.dist index 3ae89d810..5da230de6 100644 --- a/imp/config/prefs.php.dist +++ b/imp/config/prefs.php.dist @@ -1026,8 +1026,13 @@ $_prefs['disposition_send_mdn'] = array( // Locked by default 'locked' => true, 'shared' => false, - 'type' => 'checkbox', - 'desc' => _("Prompt to send read receipt when requested by the sender?"), + 'type' => 'enum', + 'enum' => array( + 0 => _("Never send read receipt"), + 1 => _("Always prompt"), + 2 => _("Prompt only if necessary; otherwise automatically send") + ), + 'desc' => _("Prompt to send read receipt (a/k/a message disposition notification) when requested by the sender?"), 'help' => 'prefs-disposition_send_mdn' ); diff --git a/imp/lib/Ui/Message.php b/imp/lib/Ui/Message.php index 5fe6330a4..99660d2de 100644 --- a/imp/lib/Ui/Message.php +++ b/imp/lib/Ui/Message.php @@ -68,8 +68,9 @@ class IMP_Ui_Message */ public function MDNCheck($mailbox, $uid, $headers, $confirmed = false) { - if (!$GLOBALS['prefs']->getValue('disposition_send_mdn') || - $GLOBALS['imp_imap']->isReadOnly($mailbox)) { + $pref_val = $GLOBALS['prefs']->getValue('disposition_send_mdn'); + + if (!$pref_val || $GLOBALS['imp_imap']->isReadOnly($mailbox)) { return false; } @@ -107,7 +108,9 @@ class IMP_Ui_Message } /* See if we need to query the user. */ - if ($mdn->userConfirmationNeeded() && !$confirmed) { + if (!$confirmed && + ((intval($pref_val) == 1) || + $mdn->userConfirmationNeeded())) { return true; }