- $should_expunge = true;
- sqimap_msgs_list_move ($imap_stream, $ids, $where_to, false);
+ if (!sqimap_msgs_list_move ($imap_stream, $ids, $where_to, false)) {
+ // if errors occurred, don't try to filter again during this session
+ sqsession_register(TRUE, 'filters_error');
+ global $color;
+ error_box(_("A problem occurred filtering messages. Check filter settings and account quota if applicable. Filtering is disabled for the remainder of this login session."), $color);
+ }
+
+ // expunge even in the case of errors, in case some
+ // messages were filtered before the error happened
+ $should_expunge = true;