On 11/14/2013 7:17 PM, Yanko Hernández Álvarez wrote: > Hello: > > I'm loosing my mind trying to classify my outgoing messages with > sieve-test (2.0.9, centos 6.4). It came to the point I think it's not > even possible with a sieve script.
Outgoing? Sieve is currently only applicable to incoming e-mail. If you managed to do something like this, I'd be interested to find out how. :) > I need to classify my outgoing messages in three folders: > > 1- To my department (@dept.example.com) > 2- To my company (@example.com, @anyotherdept.example.com) > (anyotherdept.example.com as in a way to say "any other domain that > ends with 'example.com', but not 'dept.example.com'") > 3- To the rest of the word (@any.other.domain) > > The problematic requirement is I need to make a copy in EVERY IMAP > folder that applies. For instance: for an email such as > ---- > From: [email protected] > To: [email protected], [email protected], [email protected] > ... > ---- > I need to make a copy to all folders: Dept (because of > [email protected]), Company (because of [email protected]) and Rest > (because of [email protected]). > This should solve the first two: require "fileinto"; require "relational"; if address :is :domain "To" "dept.example.com" { fileinto "Dept"; } if allof ( address :value "ne" :domain "To" "dept.example.com", anyof ( address :matches :domain "To" "*.example.com", address :is :domain "To" "example.com")) { fileinto "Company"; } Unfortunately, I cannot find a way to do #3. Perhaps some extremely convolved regular expression, but I wouldn't want to go there. Basically one needs to test that at least one of the addresses in the message does not match *.example.com, but I don't see how that could be achieved. Regards, Stephan.
