Sieve Filtering on "attachment content-type"?

Ken Murchison ken at oceana.com
Thu Mar 31 21:52:26 EST 2005


Marc G. Fournier wrote:

> 
> After alot of playing around, and finally finding a suitable headering 
> that exists in *most* of the messsages that I'm trying to filter on, 
> I've come up with the following filter ot clean out the "other language" 
> emails that I just can't read:
> 
> if allof ( header :contains [ "Content-Type" ]
>            [
>              "charset=\"GB2312\"",
>              "charset=GB2312",
>              "charset=\"ks_c_5601-1987\"",
>              "charset=ks_c_5601-1987",
>              "charset=\"koi8-r\"",
>              "charset=koi8-r",
>              "charset=\"ISO-2022-JP\"",
>              "charset=ISO-2022-JP",
>              "charset=\"Windows-1251\"",
>              "charset=Windows-1251",
>              "charset=\"EUC\"",
>              "charset=EUC"
>            ] ) {
>   fileinto "inbox.garbage";
>   stop;
> }
> 
> The ones taht sem tobe getting through now are the ones that are of one 
> of the above charset's, but instead of in the 'message headers', its 
> defined in teh 'mime headers' for the attachment itself, so the above 
> filter, of course, fails ...
> 
> Is there a way of filtering on the mime headers themselves?  So I trap 
> for when the attachment is of charset above?

You could use the 'body' test which is present in Cyrus 2.3, but you 
would just be matching text, not just MIME headers.


-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list