squirrelmail-webmail
1.4.22
|
Go to the documentation of this file. 32 define(
'SM_PATH',
'../../');
35 require_once(
SM_PATH .
'include/validate.php');
36 require_once(
SM_PATH .
'functions/page_header.php');
37 require_once(
SM_PATH .
'functions/imap.php');
38 require_once(
SM_PATH .
'functions/imap_mailbox.php');
39 require_once(
SM_PATH .
'include/load_prefs.php');
40 require_once(
SM_PATH .
'functions/forms.php');
41 require_once(
SM_PATH .
'plugins/filters/filters.php');
58 if(! isset($theid) ) $theid = 0;
82 $filter_what = str_replace(
',',
'###COMMA###', $filter_what);
83 $filter_what = str_replace(
"\\\\",
"\\", $filter_what);
84 $filter_what = str_replace(
"\\\"",
'"', $filter_what);
85 $filter_what = str_replace(
'"',
'"', $filter_what);
87 if (empty($filter_what)) {
88 do_error(
_(
"WARNING! You must enter something to search for."));
92 if (($filter_where ==
'Header') && (strchr($filter_what,
':') ==
'')) {
93 do_error(
_(
"WARNING! Header filters should be of the format "Header: value""));
99 $filters[$theid][
'where'] = $filter_where;
100 $filters[$theid][
'what'] = $filter_what;
101 $filters[$theid][
'folder'] = $filter_folder;
112 echo
'<br /><center><b>'._(
"Saved Scan type").
"</b></center>\n";
121 '<center><b>' .
_(
"Options") .
' - ' .
_(
"Message Filtering") .
'</b></center>' ,
125 'center',
'',
'width="95%" border="0" cellpadding="2" cellspacing="0"' 127 '<br /><form method="post" action="options.php">'.
129 html_tag(
'table',
'',
'',
'',
'border="0" cellpadding="2" cellspacing="0"' ) .
131 html_tag(
'th',
_(
"What to Scan:"),
'right',
'',
'nowrap' ) .
133 '<select name="filters_user_scan_set">'.
138 echo
'>' .
_(
"All messages") .
'</option>'.
139 '<option value="new"';
143 echo
'>' .
_(
"Only unread messages") .
'</option>' .
146 html_tag(
'td',
'<input type="submit" name="user_submit" value="' .
_(
"Save") .
'" />',
'left' ) .
151 html_tag(
'div',
'[<a href="options.php?action=add">' .
_(
"New") .
152 '</a>] - [<a href="'.
SM_PATH.
'src/options.php">' .
_(
"Done") .
'</a>]' ,
153 'center' ) .
'<br />';
161 if (strtolower(
$boxes[$a][
'formatted']) ==
'inbox') {
167 if ( !isset($theid) ) {
170 echo
html_tag(
'div',
'',
'center' ) .
171 '<form action="options.php" method="post">'.
172 html_tag(
'table',
'',
'',
'',
'border="0" cellpadding="2" cellspacing="0"' ) .
176 '<select name="filter_where">';
178 $L = isset(
$filters[$theid][
'where']);
180 $sel = (($L &&
$filters[$theid][
'where'] ==
'From')?
'selected':
'');
181 echo
"<option value=\"From\" $sel>" .
_(
"From") .
'</option>';
183 $sel = (($L &&
$filters[$theid][
'where'] ==
'To')?
'selected':
'');
184 echo
"<option value=\"To\" $sel>" .
_(
"To") .
'</option>';
186 $sel = (($L &&
$filters[$theid][
'where'] ==
'Cc')?
'selected':
'');
187 echo
"<option value=\"Cc\" $sel>" .
_(
"Cc") .
'</option>';
189 $sel = (($L &&
$filters[$theid][
'where'] ==
'To or Cc')?
'selected':
'');
190 echo
"<option value=\"To or Cc\" $sel>" .
_(
"To or Cc") .
'</option>';
192 $sel = (($L &&
$filters[$theid][
'where'] ==
'Subject')?
'selected':
'');
193 echo
"<option value=\"Subject\" $sel>" .
_(
"Subject") .
'</option>';
195 $sel = (($L &&
$filters[$theid][
'where'] ==
'Header')?
'selected':
'');
196 echo
"<option value=\"Header\" $sel>" .
_(
"Header") .
'</option>';
202 html_tag(
'td',
_(
"Contains:"),
'right' ) .
204 '<input type="text" size="32" name="filter_what" value="';
205 if (isset(
$filters[$theid][
'what'])) {
206 echo htmlspecialchars(
$filters[$theid][
'what']);
212 html_tag(
'td',
_(
"Move to:"),
'left' ) .
215 '<select name="filter_folder">';
217 if ( isset(
$filters[$theid][
'folder']) )
225 '<input type="submit" name="filter_submit" value="' .
_(
"Submit") .
"\" />\n".
232 echo
html_tag(
'table',
'',
'center',
'',
'border="0" cellpadding="3" cellspacing="0"' );
238 echo
html_tag(
'tr',
'',
'', $clr ) .
241 "[<a href=\"options.php?theid=$i&action=edit\">" .
_(
"Edit") .
'</a>]'.
246 "[<a href=\"options.php?theid=$i&action=delete\">" .
_(
"Delete") .
'</a>]'.
251 echo
html_tag(
'td',
'',
'center' ) .
'<small>[';
253 echo
"<a href=\"options.php?theid=$i&action=move_down\">" .
_(
"Down") .
'</a>';
255 echo
' | ';
259 echo
"<a href=\"options.php?theid=$i&action=move_up\">" .
_(
"Up") .
'</a>';
261 echo
']</small></td>';
263 echo
html_tag(
'td',
'-',
'left' ) .
265 printf(
_(
"If %s contains %s then move to %s"),
277 'center',
'',
'width="80%" border="0" cellpadding="2" cellspacing="0"' );
278 echo
'</body></html>';
if(! sqgetGlobalVar('sound', $sound, SQ_GET)) elseif($sound=='(none)')
sqgetGlobalVar($name, &$value, $search=SQ_INORDER)
getPref($data_dir, $username, $string, $default='')
html_tag( $tag, $val='', $align='', $bgcolor='', $xtra='')
sqimap_login($username, $password, $imap_server_address, $imap_port, $hide)
setPref($data_dir, $username, $string, $set_to)
if(sqgetGlobalVar('filter_submit', $filter_submit, SQ_POST)) elseif(isset($action) && $action=='delete') elseif(isset($action) && $action=='move_up') elseif(isset($action) && $action=='move_down') elseif(sqgetGlobalVar('user_submit', $user_submit, SQ_POST)) $filters
sqimap_logout($imap_stream)
sqimap_mailbox_option_list($imap_stream, $show_selected=0, $folder_skip=0, $boxes=0, $flag='noselect', $use_long_format=false)
imap_utf7_decode_local($s)
sqimap_mailbox_list($imap_stream, $force=false)
if($spamcop_quick_report) $selected