Hello all, I am testing Dovecot 2.0.13, with sieve for the vacation. I have some problems with the :regex as i can see... An example: # Sieve Filter # Generato da Ingo (http://www.horde.org/ingo/) (10/06/2011, 04:45:07) require ["vacation", "regex"]; # Vacanze if allof ( not exists ["list-help", "list-unsubscribe", "list-subscribe", "list-owner", "list-post", "list-archive", "list-id", "Mailing-List"], not header :comparator "i;ascii-casemap" :is "Precedence" ["list", "bulk", "junk"], not header :comparator "i;ascii-casemap" :matches "To" "Multiple recipients of*" ) { if header :regex "Received" "^.*(2011) (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" { if header :regex "Received" "^.*(Jun) (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" { if header :regex "Received" "^.*(10) (\\(.*\\) )?... (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" { vacation :days 7 :addresses "claudio at mediaservice.net" :subject "Test autoresponder" "test autoresponder 22"; } } } } If i test this script with sieve-test, the result is the following: sieve-test .dovecot.sieve new/1307715082.M173915P16839.mail2\,S\=1138\,W\=1168 sieve-test(root): Debug: Effective uid=0, gid=0, home=/root sieve-test(root): Debug: Namespace : type=private, prefix=INBOX., sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/mail/virtual//root sieve-test(root): Debug: maildir++: root=/var/mail/virtual//root, index=, control=, inbox=/var/mail/virtual//root sieve-test(root): Debug: none: root=, index=, control=, inbox Performed actions: (none) Implicit keep: * store message in folder: INBOX sieve-test(root): Info: final result: success No vacation is performed..... Then, if i modify the script commenting all the regex for the date, the result is the following: sieve-test .dovecot.sieve new/1307715082.M173915P16839.mail2\,S\=1138\,W\=1168 sieve-test(root): Debug: Effective uid=0, gid=0, home=/root sieve-test(root): Debug: Namespace : type=private, prefix=INBOX., sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/mail/virtual//root sieve-test(root): Debug: maildir++: root=/var/mail/virtual//root, index=, control=, inbox=/var/mail/virtual//root sieve-test(root): Debug: none: root=, index=, control=, inbox Performed actions: * send vacation message: => seconds : 604800 => subject: Test autoresponder => handle : test autoresponder 22Test autoresponder<default-from><NO-MIME> START MESSAGE test autoresponder 22 END MESSAGE Implicit keep: * store message in folder: INBOX sieve-test(root): Info: final result: success But the date is right: date Fri Jun 10 17:22:14 CEST 2011 So, what is wrong? Any help is well accepted, that script with dovecot 1.x is working correctly.... So, what is changed in dovecot 2.0 sieve? Cordially, Claudio Prono. -- -------------------------------------------------------------------------------- Claudio Prono OPST System Developer Gsm: +39-349-54.33.258 @PSS Srl Tel: +39-011-32.72.100 Via San Bernardino, 17 Fax: +39-011-32.46.497 10141 Torino - ITALY http://atpss.net/disclaimer -------------------------------------------------------------------------------- PGP Key - http://keys.atpss.net/c_prono.asc
Il 14/06/2011 10.06, Claudio Prono ha scritto:> Hello all, > > I am testing Dovecot 2.0.13, with sieve for the vacation. > > I have some problems with the :regex as i can see... > > An example: > > # Sieve Filter > # Generato da Ingo (http://www.horde.org/ingo/) (10/06/2011, 04:45:07) > > require ["vacation", "regex"]; > > # Vacanze > if allof ( not exists ["list-help", "list-unsubscribe", > "list-subscribe", "list-owner", "list-post", "list-archive", "list-id", > "Mailing-List"], not header :comparator "i;ascii-casemap" :is > "Precedence" ["list", "bulk", "junk"], not header :comparator > "i;ascii-casemap" :matches "To" "Multiple recipients of*" ) { > if header :regex "Received" "^.*(2011) (\\(.*\\) )?..:..:.. (\\(.*\\) > )?(\\+|\\-)....( \\(.*\\))?$" { > if header :regex "Received" "^.*(Jun) (\\(.*\\) )?.... (\\(.*\\) > )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" { > if header :regex "Received" "^.*(10) (\\(.*\\) )?... (\\(.*\\) )?.... > (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" { > vacation :days 7 :addresses "claudio at mediaservice.net" :subject > "Test autoresponder" "test autoresponder 22"; > } > } > } > > } > > If i test this script with sieve-test, the result is the following: > > sieve-test .dovecot.sieve > new/1307715082.M173915P16839.mail2\,S\=1138\,W\=1168 > sieve-test(root): Debug: Effective uid=0, gid=0, home=/root > sieve-test(root): Debug: Namespace : type=private, prefix=INBOX., sep=, > inbox=yes, hidden=no, list=yes, subscriptions=yes > location=maildir:/var/mail/virtual//root > sieve-test(root): Debug: maildir++: root=/var/mail/virtual//root, > index=, control=, inbox=/var/mail/virtual//root > sieve-test(root): Debug: none: root=, index=, control=, inbox> > Performed actions: > > (none) > > Implicit keep: > > * store message in folder: INBOX > > sieve-test(root): Info: final result: success > > No vacation is performed..... > > Then, if i modify the script commenting all the regex for the date, the > result is the following: > > sieve-test .dovecot.sieve > new/1307715082.M173915P16839.mail2\,S\=1138\,W\=1168 > sieve-test(root): Debug: Effective uid=0, gid=0, home=/root > sieve-test(root): Debug: Namespace : type=private, prefix=INBOX., sep=, > inbox=yes, hidden=no, list=yes, subscriptions=yes > location=maildir:/var/mail/virtual//root > sieve-test(root): Debug: maildir++: root=/var/mail/virtual//root, > index=, control=, inbox=/var/mail/virtual//root > sieve-test(root): Debug: none: root=, index=, control=, inbox> > Performed actions: > > * send vacation message: > => seconds : 604800 > => subject: Test autoresponder > => handle : test autoresponder 22Test > autoresponder<default-from><NO-MIME> > > START MESSAGE > test autoresponder 22 > END MESSAGE > > Implicit keep: > > * store message in folder: INBOX > > sieve-test(root): Info: final result: success > > But the date is right: > > date > Fri Jun 10 17:22:14 CEST 2011 > > So, what is wrong? Any help is well accepted, that script with dovecot > 1.x is working correctly.... So, what is changed in dovecot 2.0 sieve? > > Cordially, > > Claudio Prono. >Ping, anyone for this problem? -- -------------------------------------------------------------------------------- Claudio Prono OPST System Developer Gsm: +39-349-54.33.258 @PSS Srl Tel: +39-011-32.72.100 Via San Bernardino, 17 Fax: +39-011-32.46.497 10141 Torino - ITALY http://atpss.net/disclaimer -------------------------------------------------------------------------------- PGP Key - http://keys.atpss.net/c_prono.asc
Op 14-6-2011 10:06, Claudio Prono schreef:> Hello all, > > I am testing Dovecot 2.0.13, with sieve for the vacation. > > I have some problems with the :regex as i can see... > > An example:<snip/> I didn't know Horde Ingo produces such horribly ugly Sieve code; the header checks are unnecessary and the regexes are highly convolved and should probably be substituted with a `date' test. <snip/>> No vacation is performed..... > > Then, if i modify the script commenting all the regex for the date, the > result is the following:<snip/>> But the date is right: > > date > Fri Jun 10 17:22:14 CEST 2011 > > So, what is wrong? Any help is well accepted, that script with dovecot > 1.x is working correctly.... So, what is changed in dovecot 2.0 sieve?I'm currently on vacation and I can't quite get my head around these regexes. The best thing you can do now is debug it in more detail by using the sieve-test trace debugging features (using -t and -T options), as documented in the man page. This way, you can see what is matched how and which actions are performed. Then, you can narrow it down to one specific failing test. Regards, Stephan.