Hi, I found the following code on the net which should redirect all mails to another address depending on the time of day (useful for forwarding mails to work): require ["regex"]; if allof (header :regex "date" "(08|09|10|11|12|13|14|15|16|17):..:..", not header :regex "date" "(sat|sun)") { redirect "address at work>"; keep; } To check and test I simplified the regex to match all mails within a certain hour: require ["regex"]; if header :regex "date" "20:..:.." { redirect "user at domain"; keep; } Both scripts compile fine, but their regex never match. Has anyone an idea why? I'm using Dovecot 1.0.0 on Debian Etch stable. Frank
On Sun, 2007-11-25 at 00:01 +0100, frank.kintrup at fkware.de wrote:> Both scripts compile fine, but their regex never match. Has anyone > an idea why? I'm using Dovecot 1.0.0 on Debian Etch stable.So I guess you also use Debian-compiled Sieve plugin? It's possible that it doesn't have regex support compiled in. I'm not sure if it gives any errors or if it just silently ignores it.. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20071126/c5656fe4/attachment-0002.bin>
Hi Timo,>> Both scripts compile fine, but their regex never match. Has anyone >> an idea why? I'm using Dovecot 1.0.0 on Debian Etch stable. > > So I guess you also use Debian-compiled Sieve plugin? It's possible that > it doesn't have regex support compiled in. I'm not sure if it gives any > errors or if it just silently ignores it..No, no errors, so regex support was compiled in. The regex just never matched/always returned false. I've installed version 1.0.5 from the Debian testing branch yesterday evening, and now it works, so the problem has already been fixed. Frank