From: bbice Date: Fri, 5 Apr 2002 07:57:33 +0000 (+0000) Subject: Added a search by header option to filters -- needs error checking on the searchstring X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9da6bddefa1d114054daf5828aaffbdc8d7c9a7d;p=squirrelmail.git Added a search by header option to filters -- needs error checking on the searchstring git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2685 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/filters/filters.php b/plugins/filters/filters.php index 887d2c87..a144822c 100644 --- a/plugins/filters/filters.php +++ b/plugins/filters/filters.php @@ -333,6 +333,11 @@ function filter_search_and_delete($imap, $where, $what, $where_to) { } else { $search_str = "SEARCH CHARSET US-ASCII ALL "; } + if ($where == "Header") { + $what = explode(':', $what); + $where = trim($where . ' ' . $what[0]); + $what = addslashes(trim($what[1])); + } $search_str .= $where . ' {' . strlen($what) . "}\r\n" . $what . "\r\n"; fputs ($imap, "a001 $search_str"); diff --git a/plugins/filters/options.php b/plugins/filters/options.php index 0fde042a..cbf2c152 100644 --- a/plugins/filters/options.php +++ b/plugins/filters/options.php @@ -96,6 +96,9 @@ $sel = (($L && $filters[$theid]['where'] == 'Subject')?'selected':''); echo "'; + $sel = (($L && $filters[$theid]['where'] == 'Header')?'selected':''); + echo "'; + echo ''. ''. ''.