diff --git a/filter/edit.cgi b/filter/edit.cgi index f59952005..ff9e7209b 100755 --- a/filter/edit.cgi +++ b/filter/edit.cgi @@ -87,6 +87,7 @@ else { $regexp = 1; } } +$condvalue = &mailbox::decode_mimewords($condvalue); print &ui_table_row( &ui_oneradio("cmode", 4, $text{'edit_cmode4'}, $cmode == 4), &text('edit_cheader2', diff --git a/filter/filter-lib.pl b/filter/filter-lib.pl index 57bbb3d52..2199e1a6f 100755 --- a/filter/filter-lib.pl +++ b/filter/filter-lib.pl @@ -533,6 +533,7 @@ return wantarray ? ( $cond, $lastalways ) : $cond; # prettify_regexp(string) # If a string contains only \ quoted special characters, remove the \s +# Also, undo any mimewords encoding. sub prettify_regexp { my ($str) = @_; @@ -541,7 +542,7 @@ $re =~ s/\\./x/g; if ($re =~ /^[a-zA-Z0-9_ ]*$/) { $str =~ s/\\(.)/$1/g; } -return $str; +return &mailbox::decode_mimewords($str); } # describe_action(&filter, &folder, [homedir]) diff --git a/filter/save.cgi b/filter/save.cgi index 8144d9b65..7c0175029 100755 --- a/filter/save.cgi +++ b/filter/save.cgi @@ -83,7 +83,10 @@ else { $filter->{'condheader'} = $in{'condmenu'} || $in{'condheader'}; $filter->{'condheader'} =~ /^[a-zA-Z0-9\-]+$/ || &error($text{'save_econdheader'}); - $in{'condvalue'} = &mailbox::encode_mimeword($in{'condvalue'}); + if ($in{'condvalue'} !~ /^[\000-\177]*$/) { + $in{'condvalue'} = &mailbox::encode_mimewords( + $in{'condvalue'}, 'Charset' => &get_charset()); + } if (!$in{'condregexp'} && $in{'condvalue'} =~ /[\^\$\.\*\+\?\|\(\)\[\]\{\}\\]/) { # If the user didn't ask for a regexp but there are