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.
// 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'
);
*/
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;
}
}
/* See if we need to query the user. */
- if ($mdn->userConfirmationNeeded() && !$confirmed) {
+ if (!$confirmed &&
+ ((intval($pref_val) == 1) ||
+ $mdn->userConfirmationNeeded())) {
return true;
}