[Dovecot] Sieve script problem (don't know if is it possible to do this)

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Fri Nov 15 09:41:46 EET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 14 Nov 2013, Stephan Bosch wrote:

>> 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)
>>

Hi Stephan, about #3 how about the variable extension? I never used it so 
far, but it should work

> This should solve the first two:
>
> require "fileinto";
> require "relational";

require "variables";

set "done" "0";

> if address :is :domain "To" "dept.example.com" {
>    fileinto "Dept";

 	set "done" "1";

> }
>
> 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";

 	set "done" "1";
> }

   if string :is "${done}" "0" {
 	fileinto "other";
   }


- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUoXQOl3r2wJMiz2NAQKk/ggAi8ywhial+WRDJxNhZKLahQnIp8Iyn6tN
JN8MBqrALStkGZ6QLeRrgPhNuJ4I3vdbh8MnCtQR1ftH51NxUs/7X0zRIfmmdd3+
NWEBnSX5op4Qda48edUiSAXsZ69ggrzKXfqf98Rask8jXxBZG3HLR87AgVGXoEaL
c2BmT0xWf7EXsNqGBjpSCNwwzD0LpEF7mqGIVg8N+OiLrUNc0+s7BQTNdKNXmez/
1A1pt3zX+oyIBKivFvaZxxHwrNOYSZNk4+fLS2n612eUJ4ge0C0RTqolb8OEharW
TGauhXFu4Rw2w9h1rkqO1OzL8dINzQLQbhjIwj4Lhx73fVUVVZwESA==
=JwG9
-----END PGP SIGNATURE-----


More information about the dovecot mailing list