Subject: filter attachments with sieve

From: Octavio Uribe <[email-masked]>
Date: Sat, 18 May 2002 00:34:30 -0500 (CDT)

hi, i am usind iplanet messaging server, i could to
filter email by subject and content but i dont know
the axactly form to use sieve script to filter an exe
file (file.txt) in an attachment, anybody know how to
do this?  which is the right sintax?

Thanks

Octavio

_________________________________________________________
Do You Yahoo!?
La emoción e intensidad del deporte en Yahoo! Deportes. http://deportes.yahoo.com.mx

---

From: "Nigel Swinson" <[email-masked]>
Date: Sat, 18 May 2002 12:59:03 +0100

> do this?  which is the right sintax?

The base Sieve spec does not define any test for the body of a message.
Hence there is no way to test for attachments.  This is because allowing
searches in the body of a message dramatically increases the search space
making Sieve scripts much slower to execute.

However some implementations like www.Mailsite.com define an x_body
extension that allows you to search through the body for strings (and
regexes if you have the regex extension available).

The mailsite users have come to use the x_body extension quite heavily and
have ended up using tests like this:

 x_body :regex
"(^|;)(\\s*name=|begin\\s+\\d+\\s+)(\".+\\.|.+\\.)(bat|cmd|com|exe|hta|js|js
e|lnk|pif|scr|sct|shb|shs|vb|vbe|vbs|wsc|wsf|wsh|dll|ocx|msi)(\"|$|\\?=\"|\\
s+)"

Sadly they have also found that enabling such a test server-wide has
resulted in a substantial perfromance hit, which is I suppose why Sieve
didn't natively suggest an x_body extension.  This doesn't take away though
from how useful such a test can be though!!

I have no experience of iPlanets server so I can not speak for what it has
implemented.

Cheers,

Nigel