Alex
2011-Nov-15 02:30 UTC
[Dovecot] Getting started with sieve and conversion from procmail
Hi, I have a fedora15 system with dovecot-v2.0.15, dovecot-pigeonhole and and amavisd-new and would like to implement it on my system using postfix. I've read the basic wiki documentation, but I really can't figure out the proper starting point in my case. I've enabled "protocol lda" in 15-lda.conf and added "sieve" to the list of mail_plugins. I'm trying to adapt postfix to use deliver as its LDA for multiple virtual domains. I've added the following to master.cf: dovecot unix - n n - - pipe flags=DRhu user=dovecot:dovecot argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient} -a "${RECIPIENT}" Is that the proper format? Is it okay to use the dovecot user here, or should I create a new user? What permissions does this user need to possess? I've added the following to main.cf: dovecot_destination_recipient_limit = 1 virtual_transport = dovecot I have a number of procmail scripts and I've converted them to sieve, but they didn't convert very well. Can someone show me how to convert the following: :0 { :0 fhW | /home/alex/bin/process-mail.pl } The script skipped right over that. I'm also trying to convert the following: :0 * (RCVD_IN_DNSWL_HI|RCVD_IN_DNSWL_LOW|RCVD_IN_HOSTKARMA_W) * !USER_IN_WHITELIST * !BAYES_00 * !URIBL_ * !KHOP_RCVD_UNTRUST * !RCVD_IN_DNSWL_MED * !SPF_SOFTFAIL * SPF_HELO_PASS * SPF_PASS { LOG="DNSWL: " :0: whitelist/dnswl } The script only produced the following: if true { if true { if true { if true { if true { if true { if true { if true { if true { if true { fileinto "{"; fileinto " LOG="DNSWL: ""; fileinto " :0:"; fileinto " whitelist/dnswl"; fileinto "}"; } Any ideas greatly appreciated. Thanks, Alex
Stephan Bosch
2011-Nov-15 07:41 UTC
[Dovecot] Getting started with sieve and conversion from procmail
On 11/15/2011 3:30 AM, Alex wrote:> I have a number of procmail scripts and I've converted them to sieve, > but they didn't convert very well. Can someone show me how to convert > the following: > > :0 > { > :0 fhW > | /home/alex/bin/process-mail.pl > } > > The script skipped right over that.The Sieve language doesn't support invoking external programs. You can execute this program before Sieve, for instance by wrapping the LDA invocation. Also, there is a non-standard (an still pretty much experimental) language extension for this, as provided by the pipe plugin: http://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Pipe> I'm also trying to convert the following: > > :0 > * (RCVD_IN_DNSWL_HI|RCVD_IN_DNSWL_LOW|RCVD_IN_HOSTKARMA_W) > * !USER_IN_WHITELIST > * !BAYES_00 > * !URIBL_ > * !KHOP_RCVD_UNTRUST > * !RCVD_IN_DNSWL_MED > * !SPF_SOFTFAIL > * SPF_HELO_PASS > * SPF_PASS > { > LOG="DNSWL: " > :0: > whitelist/dnswl > } > > The script only produced the following:[...]> Any ideas greatly appreciated.I'm not sure what these rules are supposed to mean (most conditions are obscured in variables), but by the looks of things these should also be executed outside Sieve as well. If all those conditions map to simple header and envelope tests, you can provide a Sieve alternative. However, I think USER_IN_WHITELIST queries some external list and that too is not (currently) possible from Pigeonhole Sieve. Also, it is not possible to change the log prefix from Sieve (as suggested by LOG=). Regards, Stephan