From: cigamit Date: Mon, 21 Mar 2005 22:42:53 +0000 (+0000) Subject: Add ability to filter on the Message body, or if text appears any where in the messag... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8a7ccd82d976b4a709e284887925d912872be13a;p=squirrelmail.git Add ability to filter on the Message body, or if text appears any where in the message (Header or Body). The strings are already translated via our search form This should close Feature Request # 509443 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9126 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/filters/filters.php b/plugins/filters/filters.php index a414573d..98935f3b 100644 --- a/plugins/filters/filters.php +++ b/plugins/filters/filters.php @@ -240,6 +240,12 @@ function user_filters($imap_stream) { $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge); $expunge = filter_search_and_delete($imap_stream, 'CC', $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge); + } else if ($filters[$i]['where'] == 'Header and Body') { + $expunge = filter_search_and_delete($imap_stream, 'TEXT', + $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge); + } else if ($filters[$i]['where'] == 'Message Body') { + $expunge = filter_search_and_delete($imap_stream, 'BODY', + $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $expunge); } else { /* * If it's a normal TO, CC, SUBJECT, or FROM, then handle it diff --git a/plugins/filters/options.php b/plugins/filters/options.php index a250aedd..161891dc 100644 --- a/plugins/filters/options.php +++ b/plugins/filters/options.php @@ -191,6 +191,12 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) { $sel = (($L && $filters[$theid]['where'] == 'Subject')?' selected="selected"':''); echo "'; + $sel = (($L && $filters[$theid]['where'] == 'Message Body')?' selected="selected"':''); + echo "'; + + $sel = (($L && $filters[$theid]['where'] == 'Header and Body')?' selected="selected"':''); + echo "'; + $sel = (($L && $filters[$theid]['where'] == 'Header')?' selected="selected"':''); echo "';