Hello,
after qmail migration need convert some .procmailrc scripts. Found converter procmail -> sieve, but i'm not sure of quality of conversion.
My script:
if header :contains "from" ["user@domain1.tld", "user2@domain2.tld", "user3@domain3.tld"] { redirect "foo1@bar.tld"; redirect "foo2@bar.tld"; .... redirect "foo20@bar.tld"; } else { keep; }
Converter script:
require ["fileinto","regex","envelope","vacation"];
if envelope :comparator "i;octet" :contains "From.*(user@domain1.tld|user2@domain2.tld|user3@domain3.tld)" "" { redirect "foo1@bar.tld foo2@bar.tld .... foo20@bar.tld"; }
if true { fileinto "$DEFAULT"; }
Converter script is cannot be compiled. But it used other style envelope.
So what is difference between envelope and header ? And there are some limits for redirect ?
Thank you.
Lampa
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 29 Jan 2010, Lampa wrote:
My script:
if header :contains "from" ["user@domain1.tld", "user2@domain2.tld", "user3@domain3.tld"] { redirect "foo1@bar.tld"; redirect "foo2@bar.tld"; .... redirect "foo20@bar.tld"; } else { keep; }
either add "stop;" after redirects or remove the else branch, because after the redirects you'll have the implict "keep", as far as I know.
require ["fileinto","regex","envelope","vacation"];
if envelope :comparator "i;octet" :contains "From.*(user@domain1.tld|user2@domain2.tld|user3@domain3.tld)" "" {
I would expect: "From" "(user ....)" {
http://ietfreport.isoc.org/rfc/rfc5228.txt sec 5.4
redirect "foo1@bar.tld foo2@bar.tld .... foo20@bar.tld";
The RFC uses singular with the "redirect" argument, hence, I suppose, it is implementor-defined, whether or not the space-delimited recipients will work.
if true { fileinto "$DEFAULT";
There is no $DEFAULT, IMHO.
Converter script is cannot be compiled. But it used other style envelope.
What's the error?
So what is difference between envelope and header ?
"header" compares the values in the mail itself, e.g. "From", "To", but "Subject", "X-Scanned", too. "envelope" compares values of the SMTP-phase commands, "From" corresponds to the "MAIL FROM" SMTP command and "To" to the "Rcpt to" command. The availability of those envelope information differs among the MTAs, some do not provide "MAIL FROM" at all, some do provide all "RCPT TO"s, some only the "RCPT TO" of the particular recipient, some only if there is exactly one recipient.
Therefore the RFC states that implemenations SHOULD have "envelope". It is no requirement.
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBS2Lx6b+Vh58GPL/cAQL5zwgAwnm7iOhl2rgdnw8a3lVCP0j9nnLW/rKF IJ4GNbgCUyr+fLdixYL8TJt0kxq5pvjdviW/wII96Phqaom0iQi/GCC0fg0aKSqJ SXsDP12nfcgENsg8DgXNBMtPVzSUHMRL04EDB9Jox+P1ulxhsKVholKHVwObdbew BoEt04YmRtvWNJYF1rNM6fDxIV9FeA1w9FMeO6XSsWbY2jHY42NdJAtQibL36DbO KyCDH207Ykzc+GZi0n8jeJGyIC1ZvH+DT0pXVE1jj1gslOjsBKDLrJ+jIJfMDJfZ HEYPXxxkvTR/QQn1OBJKlOGYGO2d67/roqIYbArsIcxr6KRDJ95vNw== =FLGC -----END PGP SIGNATURE-----
2010/1/29 Steffen Kaiser skdovecot@smail.inf.fh-brs.de:
My script:
if header :contains "from" ["user@domain1.tld", "user2@domain2.tld", "user3@domain3.tld"] { redirect "foo1@bar.tld"; redirect "foo2@bar.tld"; .... redirect "foo20@bar.tld"; } else { keep; }
either add "stop;" after redirects or remove the else branch, because after the redirects you'll have the implict "keep", as far as I know.
Ok, thank you.
require ["fileinto","regex","envelope","vacation"];
if envelope :comparator "i;octet" :contains "From.*(user@domain1.tld|user2@domain2.tld|user3@domain3.tld)" "" {
I would expect: "From" "(user ....)" {
That is why can't be compiled.
redirect "foo1@bar.tld foo2@bar.tld .... foo20@bar.tld";
The RFC uses singular with the "redirect" argument, hence, I suppose, it is implementor-defined, whether or not the space-delimited recipients will work.
No it's not working:
.dovecot: line 3: error: specified redirect address foo1@bar.tld foo2@bar.tld foo20@bar.tld' is invalid: address ends in invalid characters. .dovecot: error: validation failed.
if true { fileinto "$DEFAULT";
There is no $DEFAULT, IMHO.
Converter script is cannot be compiled. But it used other style envelope.
What's the error?
line 5: error: specified envelope part 'From.*(user@domain1.tld|user2@domain2.tld|user3@domain3.tld...' is not supported by the envelope test.
Syntax problem.
So what is difference between envelope and header ?
"header" compares the values in the mail itself, e.g. "From", "To", but "Subject", "X-Scanned", too. "envelope" compares values of the SMTP-phase commands, "From" corresponds to the "MAIL FROM" SMTP command and "To" to the "Rcpt to" command. The availability of those envelope information differs among the MTAs, some do not provide "MAIL FROM" at all, some do provide all "RCPT TO"s, some only the "RCPT TO" of the particular recipient, some only if there is exactly one recipient.
Therefore the RFC states that implemenations SHOULD have "envelope". It is no requirement.
Thank you.
-- Lampa
2010/1/29 Steffen Kaiser skdovecot@smail.inf.fh-brs.de:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 29 Jan 2010, Lampa wrote:
My script:
if header :contains "from" ["user@domain1.tld", "user2@domain2.tld", "user3@domain3.tld"] { redirect "foo1@bar.tld"; redirect "foo2@bar.tld"; .... redirect "foo20@bar.tld"; } else { keep; }
either add "stop;" after redirects or remove the else branch, because after the redirects you'll have the implict "keep", as far as I know.
Negative. I must specify keep after redirect to keep copy & redirect.
It's about implementation ?
-- Lampa
Lampa wrote:
Hello,
after qmail migration need convert some .procmailrc scripts. Found converter procmail -> sieve, but i'm not sure of quality of conversion.
My script:
if header :contains "from" ["user@domain1.tld", "user2@domain2.tld", "user3@domain3.tld"] { redirect "foo1@bar.tld"; redirect "foo2@bar.tld"; .... redirect "foo20@bar.tld"; } else { keep; }
Converter script:
require ["fileinto","regex","envelope","vacation"];
if envelope :comparator "i;octet" :contains "From.*(user@domain1.tld|user2@domain2.tld|user3@domain3.tld)" "" { redirect "foo1@bar.tld foo2@bar.tld .... foo20@bar.tld"; }
if true { fileinto "$DEFAULT"; } This not Sieve. There is no envelope part "From.*(... " and redirect only accepts one address.
Converter script is cannot be compiled. But it used other style envelope.
The converter's script does not make much sense, although I can see what it is trying to do.
So what is difference between envelope and header ?
The header test matches against headers of the message itself. The envelope test matches against the SMTP envelope.
And there are some limits for redirect ?
Check the 'Configurable Limits' section of the INSTALL file (wiki needs to be updated):
http://hg.rename-it.nl/dovecot-1.2-sieve/file/0.1.15/INSTALL
So, you can configure sieve_max_redirects according to your needs.
Regards,
Stephan.
2010-01-29T19:52:15.876551+01:00 hermes dovecot: deliver(user@domain.tld): sieve: main_script: line 6: number of redirect actions exceeds policy limit 2010-01-29T19:52:15.881478+01:00 hermes dovecot: deliver(centrumrealit@remax-czech.cz): sieve: execution of script /home/mail/domain.tld/user/.dovecot.sieve failed, but implicit keep was successful
plugin { sieve = ~/.dovecot.sieve sieve_dir = ~/sieve
sieve_max_redirects = 20
sieve_global_path = /home/mail/.dovecot.global.sieve
sieve_global_dir = /home/mail/sieve
}
using dovecot 1.2.9 on debain
2010/1/29 Stephan Bosch s.bosch@utwente.nl:
Lampa wrote:
Hello,
after qmail migration need convert some .procmailrc scripts. Found converter procmail -> sieve, but i'm not sure of quality of conversion.
My script:
if header :contains "from" ["user@domain1.tld", "user2@domain2.tld", "user3@domain3.tld"] { redirect "foo1@bar.tld"; redirect "foo2@bar.tld"; .... redirect "foo20@bar.tld"; } else { keep; }
Converter script:
require ["fileinto","regex","envelope","vacation"];
if envelope :comparator "i;octet" :contains "From.*(user@domain1.tld|user2@domain2.tld|user3@domain3.tld)" "" { redirect "foo1@bar.tld foo2@bar.tld .... foo20@bar.tld"; }
if true { fileinto "$DEFAULT"; }
This not Sieve. There is no envelope part "From.*(... " and redirect only accepts one address.
Converter script is cannot be compiled. But it used other style envelope.
The converter's script does not make much sense, although I can see what it is trying to do.
So what is difference between envelope and header ?
The header test matches against headers of the message itself. The envelope test matches against the SMTP envelope.
And there are some limits for redirect ?
Check the 'Configurable Limits' section of the INSTALL file (wiki needs to be updated):
http://hg.rename-it.nl/dovecot-1.2-sieve/file/0.1.15/INSTALL
So, you can configure sieve_max_redirects according to your needs.
Regards,
Stephan.
-- Lampa
Lampa wrote:
2010-01-29T19:52:15.876551+01:00 hermes dovecot: deliver(user@domain.tld): sieve: main_script: line 6: number of redirect actions exceeds policy limit 2010-01-29T19:52:15.881478+01:00 hermes dovecot: deliver(centrumrealit@remax-czech.cz): sieve: execution of script /home/mail/domain.tld/user/.dovecot.sieve failed, but implicit keep was successful
plugin { sieve = ~/.dovecot.sieve sieve_dir = ~/sieve
sieve_max_redirects = 20 sieve_global_path = /home/mail/.dovecot.global.sieve sieve_global_dir = /home/mail/sieve
}
using dovecot 1.2.9 on debain
This feature is first included in Pigeonhole Sieve 0.1.14. You need debian package version > 1:1.2.9-2, which is not yet in testing or backports.
Regards,
Stephan.
Stephan Bosch ha scritto:
Lampa wrote:
2010-01-29T19:52:15.876551+01:00 hermes dovecot: deliver(user@domain.tld): sieve: main_script: line 6: number of redirect actions exceeds policy limit 2010-01-29T19:52:15.881478+01:00 hermes dovecot: deliver(centrumrealit@remax-czech.cz): sieve: execution of script /home/mail/domain.tld/user/.dovecot.sieve failed, but implicit keep was successful
plugin { sieve = ~/.dovecot.sieve sieve_dir = ~/sieve
sieve_max_redirects = 20 sieve_global_path = /home/mail/.dovecot.global.sieve sieve_global_dir = /home/mail/sieve
}
using dovecot 1.2.9 on debain
This feature is first included in Pigeonhole Sieve 0.1.14. You need debian package version > 1:1.2.9-2, which is not yet in testing or backports.
I've already built the backport to stable. I'll upload it as soon the package will enter in testing. Meantime, if you want, you can download it (for i386 and amd64) from my private repository[1]
Kind regards, Marco
[1] http://www.prato.linux.it/~mnencia/debian/dovecot-lenny/
--
| Marco Nenciarini | Debian/GNU Linux Developer - Plug Member | | mnencia@prato.linux.it | http://www.prato.linux.it/~mnencia |
Key fingerprint = FED9 69C7 9E67 21F5 7D95 5270 6864 730D F095 E5E4
participants (5)
-
Lampa
-
Marco Nenciarini
-
Steffen Kaiser
-
Stephan Bosch
-
Stephan Bosch