[Dovecot] dovecot sieve notify mailto
Hello,
I try to migrate to dovecot-lda from procmail, but some script can't run under lda cmusieve plugin.
dovecot version: dovecot-1.0(debian)
revelant config dovecot.conf:
protocol lda { postmaster_address = postmaster@wizard.dunanet.hu hostname = wizard.dunanet.hu mail_plugin_dir = /usr/lib/dovecot/modules/lda #sendmail_path = /usr/lib/sendmail auth_socket_path = /var/run/dovecot/auth-master mail_plugins = cmusieve }
.forward | "/usr/lib/dovecot/deliver"
.dovecot.sieve (revelant part)
require ["fileinto","notify"]; ... ... notify :method "mailto" :options "9141141@sms1.pgsm.hu" :id "test" :message;
if true { keep; } ...
I can compile with sievec, deliver also can compile to .dovecot.sievec (no errors) i can decompile with sieved:
1935: NOTIFY METHOD({6}mailto) ID({5}willy) OPTIONS {20}9141141@sms1.pgsm.hu PRIORITY(13) MESSAGE({17}$from$: $subject$) 1954: IF (ends at 1957)true 1957:JUMP 1960 1959: KEEP full len is: 1960
But notification does not work..
Jul 3 17:50:38 WiZARD deliver(willy): Loading modules from directory: /usr/lib/dovecot/modules/lda Jul 3 17:50:38 WiZARD deliver(willy): Module loaded: /usr/lib/dovecot/modules/lda/lib90_cmusieve_plugin.so Jul 3 17:50:38 WiZARD deliver(willy): mbox: data=/home/willy/mail/:INBOX=/var/mail/willy Jul 3 17:50:38 WiZARD deliver(willy): mbox: root=/home/willy/mail, index=/home/willy/mail, inbox=/var/mail/willy Jul 3 17:50:38 WiZARD deliver(willy): cmusieve: Using sieve path: /home/willy/.dovecot.sieve Jul 3 17:50:38 WiZARD deliver(willy): cmusieve: Executing script /home/willy/.dovecot.sievec Jul 3 17:50:38 WiZARD postfix/smtpd[15234]: disconnect from donci.dunanet.hu[62.77.204.40] Jul 3 17:50:38 WiZARD deliver(willy): msgid=<Pine.LNX.4.62.0707031750280.28802@donci.dunanet.hu>: saved mail to INBOX Jul 3 17:50:38 WiZARD deliver(willy): sieve runtime error: Notify: Generic Error Jul 3 17:50:38 WiZARD postfix/local[15239]: B31B419746C: to=<willy@wizard.dunanet.hu>, relay=local, delay=0.1, delays=0.07/0/0/0.02, dsn=2.0.0, status=sent (delivered to command: /usr/lib/dovecot/deliver)
I always get sieve runtime error: Notify: Generic Error
Fileinto, and redirect works fine, but notify does not. I try "dovecot-sieve-1-0-64a7986b5e55.tar.bz2" without success.
Please help debug "Generic Error".
Thanks,
Udv.: Willy
PGP GNUPG/1.0 ID = 5BFA0D36 Kupor Laszlo Attila <willy@dunanet.hu> Key fingerprint = 3F68 9483 5B65 8E2F CD30 5326 50F9 5A33 5BFA 0D36
On Tue, 3 Jul 2007, Kupor Laszlo wrote:
Sorry,
I found the answer in archive.
http://article.gmane.org/gmane.mail.imap.dovecot/20813/match
Thanks,
Udv.: Willy
PGP GNUPG/1.0 ID = 5BFA0D36 Kupor Laszlo Attila <willy@dunanet.hu> Key fingerprint = 3F68 9483 5B65 8E2F CD30 5326 50F9 5A33 5BFA 0D36
Kupor Laszlo wrote:
On Tue, 3 Jul 2007, Kupor Laszlo wrote:
Sorry,
I found the answer in archive.
http://article.gmane.org/gmane.mail.imap.dovecot/20813/match
Thanks, I wrote this patch about 6 moth ago. As far, as I tested it, it works as expected. Other users reports only success with this path too. Timo: My be it's good idea to include this patch in CVS version? Anyway original code only reports "generic error" as "notify" method is unimplemented, and produces bounce messages.
Uldis
On Tue, 2007-07-03 at 21:13 +0300, Uldis Pakuls wrote:
http://article.gmane.org/gmane.mail.imap.dovecot/20813/match
Thanks, I wrote this patch about 6 moth ago. As far, as I tested it, it works as expected. Other users reports only success with this path too. Timo: My be it's good idea to include this patch in CVS version? Anyway original code only reports "generic error" as "notify" method is unimplemented, and produces bounce messages.
Yes .. Although I have another version by Petr Smotek <psm@volny.cz> as well. I haven't looked closely either of your patches, so want to tell me which one would be better? :) Attached the other one.
Timo Sirainen wrote:
On Tue, 2007-07-03 at 21:13 +0300, Uldis Pakuls wrote:
http://article.gmane.org/gmane.mail.imap.dovecot/20813/match
Thanks,
I wrote this patch about 6 moth ago. As far, as I tested it, it works as expected. Other users reports only success with this path too. Timo: My be it's good idea to include this patch in CVS version? Anyway original code only reports "generic error" as "notify" method is unimplemented, and produces bounce messages.
Yes .. Although I have another version by Petr Smotek <psm@volny.cz> as well. I haven't looked closely either of your patches, so want to tell me which one would be better? :) Attached the other one.
I have "looked closely" at both and here is result - new patch:)
Peter removed sieve action report from notify message... this my be confusing as actions are not only "keep". notify my be sent for forward, reject etc. actions, so I left this list at end of message as is.
Peter's patch tries to mark sent messages with duplicate_mark() but never used any check... Actually I dot see any reason for such marking, as notify message are not stored anywhere in mail storage - it is sent directly to external "sendmail_bin" and discarded from memory.
new things added:
- headers "Auto-Submitted: Precedence:" for better handing by auto-responders.
- check for 8bit characters in message.
and most important things: think it is wrong; if no scripts are executed or it is aborted for some
- notify now always reports SIEVE_OK as notify failure is not delivery failure. all notify failures are reported in log. Also "SIEVE_ERROR" aborts script execution, but there is no reason to abort on notify error.
- sieve plugin returns "-1" if script failed load or on any error. i
reason - it is not fatal delivery error; this just means "nothing is done" by script. so i changed plugin always return "0" on errors.
but one problem still remains... if script is executed and mail is delivered to mailbox, but next action failed (e.g. notify, vocation, etc.) deliver incorrectly sends bounce messages while mail is successfully delivered.
sample script: { keep; notify :method...[...]; <- failed action }
result is:
- message is delivered
- bounce message sent...
to fix this I wrote small patch for deliver too... my be you find this "useful"...:)
Uldis
On Fri, 2007-07-06 at 20:25 +0300, Uldis Pakuls wrote:
and most important things:
- notify now always reports SIEVE_OK as notify failure is not delivery failure. all notify failures are reported in log. Also "SIEVE_ERROR" aborts script execution, but there is no reason to abort on notify error.
These should maybe be changed elsewhere too..
- sieve plugin returns "-1" if script failed load or on any error. i think it is wrong; if no scripts are executed or it is aborted for some reason - it is not fatal delivery error; this just means "nothing is done" by script. so i changed plugin always return "0" on errors.
How about: http://hg.dovecot.org/dovecot-1.0/rev/87d0ae7fbe12
I committed the notify patch too with small changes.
participants (3)
-
Kupor Laszlo
-
Timo Sirainen
-
Uldis Pakuls