[imapfilter-devel]quotes

Lefteris Chatzibarbas lefcha at hellug.gr
Wed Sep 18 01:16:01 EEST 2002


On Tue, Sep 17, 2002 at 04:19:45PM -0400, Matej Cepl wrote:
> I have in my ~/.imapfilterrc (on Debian GNU/Linux 3.0
> woody/stable) following:
> 
>    filter spam or
>      mask header Content-Type "text/html; charset=euc-kr"
>      mask header Content-Type "text/html; charset=gb2312"
>      mask header Content-Type "text/html; charset=ks_c_5601-1987"
>      ... [further masks]
>    action delete
> 
> The problem seems to be, that sometimes the content of
> Content-Type is quoted and sometimes not. My filter I believe
> gets unquoted ones, but I do not know how to make imapfilter to
> catch both
> 
>    Content-Type: text/html; charset=euc-kr
>    
>    and
>    
>    Content-Type: text/html; charset="euc-kr"

You cannot replace the above filters with one that does the same thing
(This needs regular expressions, which the IMAP4rev1 doesn't support).

Some IMAP mail servers accept something like:

  mask header Content-Type "text/html; charset=\"euc-kr\""

> 
> (if possible, than by one mask catching both -- some kind of
> ``quotes insensitivity''). And of course, it would help when the
> program would catch also the version divided in middle, i.e.,
> something like this:
> 
>    Content-Type: text/html;
>          charset=euc-kr
> 
> (but I am know, whether the last one is not already caught).

This probably accomplishes what you want:

filter spam and
  mask header Content-Type text/html;
  mask header Content-Type euc-kr
  or header Content-Type gb2312
  or header Content-Type ks_c_5601-1987
  or ...
action delete




More information about the Imapfilter-devel mailing list