Also, break preferences into 2 to reduce confusion.
'label' => _("Deleting and Moving Messages"),
'desc' => _("Set preferences for what happens when you move and delete messages."),
'members' => array('mailbox_return', 'delete_spam_after_report',
- 'empty_spam_menu')
+ 'move_ham_after_report', 'empty_spam_menu')
);
if (!$is_pop3) {
$prefGroups['delmove']['members'] = array_merge(
'type' => 'enum',
'enum' => array(
0 => _("Nothing"),
- 1 => _("Delete spam messages")
+ 1 => _("Delete message")
),
- 'desc' => _("What should we do with spam messages after they have been reported as spam or innocent?"),
+ 'desc' => _("What should we do with spam messages after they have been reported as spam?"),
'help' => 'prefs-delete_spam_after_report'
);
if (!$is_pop3) {
$_prefs['delete_spam_after_report']['enum'][2] =
- _("Move spam messages to spam folder and innocent messages to INBOX");
+ _("Move to spam folder");
+}
+
+// What should we do with spam messages after reporting them as innocent?
+$_prefs['move_ham_after_report'] = array(
+ 'value' => 0,
+ 'locked' => false,
+ 'shared' => false,
+ 'type' => 'enum',
+ 'enum' => array(
+ 0 => _("Nothing")
+ ),
+ 'desc' => _("What should we do with spam messages after they have been reported as innocent?"),
+ 'help' => 'prefs-move_ham_after_report'
+);
+if (!$is_pop3) {
+ $_prefs['move_ham_after_report']['enum'][1] =
+ _("Move to Inbox");
}
// Replace image tags in inline viewed HTML messages with blank images?
v5.0-git
--------
+[mms] Split ham/spam reporting actions into two separate preferences (Request
+ #8221).
[mms] Add vertical-pane preview layout to DIMP.
[mms] Wrap content-related MIME parts in a border when viewing inline to
indicate their relationship.
v4.3.6-cvs
----------
+[mms] For messages marked as innocent but not moved to Inbox, don't report
+ them as deleted within the current mailbox (Bug #8221).
[jan] Don't show address book preference group if address books are disabled
(Bug #8692).
[mms] Save References/In-Reply-To header info when saving a draft (Bug #8661).
break;
case 'notspam':
- $msg = sprintf(_("The message \"%s\" has been reported as spam."), $subject);
+ $msg = sprintf(_("The message \"%s\" has been reported as innocent."), $subject);
break;
}
} elseif ($action == 'spam') {
$msg = sprintf(_("%d messages have been reported as spam."), $report_count);
} else {
- $msg = sprintf(_("%d messages have been reported as not spam."), $report_count);
+ $msg = sprintf(_("%d messages have been reported as innocent."), $report_count);
}
$notification->push($msg, 'horde.message');
- /* Delete spam after report. */
- $delete_spam = $GLOBALS['prefs']->getValue('delete_spam_after_report');
- if ($delete_spam) {
- $imp_message = IMP_Message::singleton();
- switch ($delete_spam) {
- case 1:
- if ($action == 'spam') {
+ /* Delete/move message after report. */
+ switch ($action) {
+ case 'spam':
+ if ($result = $GLOBALS['prefs']->getValue('delete_spam_after_report')) {
+ $imp_message = IMP_Message::singleton();
+ switch ($result) {
+ case 1:
$msg_count = $imp_message->delete($indices);
if ($msg_count === false) {
- $delete_spam = 0;
+ $result = 0;
} else {
if ($msg_count == 1) {
$notification->push(_("The message has been deleted."), 'horde.message');
$notification->push(sprintf(_("%d messages have been deleted."), $msg_count), 'horde.message');
}
}
- }
- break;
+ break;
- case 2:
- $targetMbox = ($action == 'spam') ? IMP::folderPref($GLOBALS['prefs']->getValue('spam_folder'), true) : 'INBOX';
- if ($targetMbox) {
- if ($imp_message->copy($targetMbox, 'move', $indices, true) === false) {
- $delete_spam = 0;
+ case 2:
+ $targetMbox = IMP::folderPref($GLOBALS['prefs']->getValue('spam_folder'), true);
+ if ($targetMbox) {
+ if (!$imp_message->copy($targetMbox, 'move', $indices, true)) {
+ $result = 0;
+ }
+ } else {
+ $notification->push(_("Could not move message to spam mailbox - no spam mailbox defined in preferences."), 'horde.error');
+ $result = 0;
}
- } else {
- $notification->push(_("Could not move message to spam mailbox - no spam mailbox defined in preferences."), 'horde.error');
- $delete_spam = 0;
+ break;
+ }
+ }
+ break;
+
+ case 'notspam':
+ if ($result = $GLOBALS['prefs']->getValue('move_ham_after_report')) {
+ $imp_message = IMP_Message::singleton();
+ if (!$imp_message->copy('INBOX', 'move', $indices)) {
+ $result = 0;
}
- break;
}
+ break;
}
- return $delete_spam;
+ return $result;
}
}
<entry id="prefs-delete_spam_after_report">
<title>Preferences: Delete Spam After Reporting</title>
<para>
- You may elect to do one of three items after reporting a message as either spam or innocent.
+ You may elect to do one of three items after reporting a message as spam.
</para>
<para>
- First, you can decide to do nothing - the message will be reported as either spam or innocent but will otherwise remain unchanged in your mailbox.
+ First, you can decide to do nothing - the message will be reported as spam but will otherwise remain unchanged in your mailbox.
</para>
<para>
- Second, if reporting a message as spam, you can instead have the message be immediately deleted. This setting has no effect on reporting a message as innocent.
+ Second, if reporting a message as spam, you can instead have the message be immediately deleted.
</para>
<para>
- Third, after reporting a message as spam the message will be deleted from the current mailbox and moved to your spam folder. Alternatively, if reporting a message as innocent the message will be deleted from the current mailbox and moved to your INBOX.
+ Third, after reporting a message as spam the message will be deleted from the current mailbox and moved to your spam folder.
+ </para>
+</entry>
+
+<entry id="prefs-move_ham_after_report">
+ <title>Preferences: Move Spam After Reporting As Innocent</title>
+ <para>
+ You may elect to do one of two items after reporting a message previously maked as spam as innocent.
+ </para>
+ <para>
+ First, you can decide to do nothing - the message will be reported as innocent but will otherwise remain unchanged in your mailbox.
+ </para>
+ <para>
+ Second, if reporting a message as innocent the message will be deleted from the current mailbox and moved to your Inbox.
</para>
</entry>