-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello guys, I'm having troubles making "script_after" to exec sieve scripts:: So: plugin { quota = maildir quota_rule2 = INBOX.Trash:ignore quota_rule3 = INBOX.Sent:ignore sieve = ~/Maildir/sieve/dovecot1.sieve sieve_before = /etc/dovecot/sieve/global.sieve sieve_after = ~/Maildir/sieve/01_vacation.sieve sieve_dir = ~/Maildir/sieve sieve_global_dir = /etc/dovecot/sieve/ sieve_quota_max_scripts = 50 expire = INBOX.Trash expire2 = INBOX.Spam expire3 = INBOX.Junk zlib_save = bz2 } ll /home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/ total 28 - -rw-------. 1 vpopmail vchkpw 912 Feb 11 19:15 01_vacation.sieve - -rw-------. 1 vpopmail vchkpw 212 Feb 11 19:13 01_vacation.svbin drwx------. 2 vpopmail vchkpw 4096 Feb 11 00:02 after lrwxrwxrwx. 1 vpopmail vchkpw 13 Feb 11 19:15 dovecot1.sieve -> filters.sieve - -rw-------. 1 vpopmail vchkpw 878 Feb 11 19:16 dovecot1.svbin - -rw-------. 1 vpopmail vchkpw 1268 Feb 11 18:48 filters.sieve - -rw-------. 1 vpopmail vchkpw 932 Feb 11 18:55 new.sieve drwx------. 2 vpopmail vchkpw 4096 Feb 11 19:15 tmp And here is the debug output: Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: file script: Opened script `01_vacation' from `/home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/01_vacation.sieve' Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: executed after user's Sieve script(3): /home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/01_vacation.sieve Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Opening script 1 of 3 from `/etc/dovecot/sieve/global.sieve' Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Loading script /etc/dovecot/sieve/global.sieve Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Script binary /etc/dovecot/sieve/global.svbin successfully loaded Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: binary save: not saving binary /etc/dovecot/sieve/global.svbin, because it is already stored Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Executing script from `/etc/dovecot/sieve/global.svbin' Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Opening script 2 of 3 from `/home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.sieve;name=filters' Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Loading script /home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.sieve;name=filters Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Script binary /home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.svbin is not up-to-date Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Script `filters' from /home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.sieve;name=filters successfully compiled Feb 11 19:16:09 lda(portase.florin at medianetork.ro): Debug: sieve: Executing script from `/home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.sieve;name=filters' Feb 11 19:16:10 lda(portase.florin at medianetork.ro): Info: sieve: msgid=<CAAa=MneAO6+wwLh3M8nz1z6Mi2Ae2aDMdrSakJA_-PYCwCvbCA at mail.gmail.com>: stored mail into mailbox 'INBOX.Gmail' If I change symlink from dovecot1.sieve -> filters.sieve to dovecot1.sieve -> 01_vacation.sieve vacation filter is working I think I miss something, but have no clue what's wrong. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU26DNAAoJECEzxtLP+204zckH/R05yYi2iLFrXpYgNE0noyDu f1sAXPHk1UC75Wz0FMLRP/QR4K4ocF4TnZAC8a0e0rLdwILZ2ys7LUL1GkF5D/m6 MLotbZh01pWaI4+C7I6Nw0GeCMBYC1VFFrh/fxVcijdICA5H6v6VmiZs7/AyWq/3 OcmzHeLD0MgHcU7l2zD7MFszYnUTGaJoqztYMzz9Mzzgff7Gw4RioJTh3PDCu/Wp gAXPcX0/8fssSRBnmsIKs7bzUxhsXnFwisq+d6xYa4O/2tG1vU1YmmsGGj9YGIAR x5wKyCcPAeOWnZZ0rLvweVs+KMr91Dl4czteMsV71ZxNzMpLIUXdtrqAGYrHeZU=PIJn -----END PGP SIGNATURE-----
On 2/11/2015 7:34 PM, Florin Portase wrote:> > Hello guys, > > I'm having troubles making "script_after" to exec sieve scripts:: >Keep in mind that the sieve_after script is only executed when the "keep" action [1] is executed or when the implicit "keep" [2] is still active, meaning that the user didn't give the mail an explicit destination. If the user does perform actions like fileinto or redirect without a `:copy' argument [3] and without performing an explicit "keep" [2] anywhere, the subsequent sieve_after scripts are not executed [4]. Therefore sieve_after is only useful to provide default behavior for when the user has no explicit rule for what should happen to the e-mail.> `/home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.sieve;name=filters' > Feb 11 19:16:10 lda(portase.florin at medianetork.ro): Info: sieve: > msgid=<CAAa=MneAO6+wwLh3M8nz1z6Mi2Ae2aDMdrSakJA_-PYCwCvbCA at mail.gmail.com>: > stored mail into mailbox 'INBOX.Gmail'This was probably done using a `fileinto "INBOX.Gmail";' command. This cancels the implicit keep. To force executing sieve_after, the user needs to add a `:copy' argument to that fileinto command or a `keep;' action should be executed. Administrator policies that always need to be executed must be placed in a sieve_before script. For more information: [1]: https://tools.ietf.org/html/rfc5228#section-4.3 [2]: https://tools.ietf.org/html/rfc5228#section-2.10.2 [3]: https://tools.ietf.org/html/rfc3894 [4]: http://tools.ietf.org/html/draft-degener-sieve-multiscript-00 Regards, Stephan.
On 2/11/2015 8:41 PM, Stephan Bosch wrote:> On 2/11/2015 7:34 PM, Florin Portase wrote: >> Hello guys, >> >> I'm having troubles making "script_after" to exec sieve scripts:: >> > Keep in mind that the sieve_after script is only executed when the > "keep" action [1] is executed or when the implicit "keep" [2] is still > active, meaning that the user didn't give the mail an explicit destination. > > If the user does perform actions like fileinto or redirect without a > `:copy' argument [3] and without performing an explicit "keep" [2] > anywhere, the subsequent sieve_after scripts are not executed [4]. > > Therefore sieve_after is only useful to provide default behavior for > when the user has no explicit rule for what should happen to the e-mail. > >> `/home/vpopmail/domains/medianetork.ro/portase.florin/Maildir/sieve/dovecot1.sieve;name=lters' >> Feb 11 19:16:10 lda(portase.florin at medianetork.ro): Info: sieve: >> msgid=AAa=MneAO6+wwLh3M8nz1z6Mi2Ae2aDMdrSakJA_-PYCwCvbCA at mail.gmail.com>: >> stored mail into mailbox 'INBOX.Gmail' > This was probably done using a `fileinto "INBOX.Gmail";' command. This > cancels the implicit keep. > > To force executing sieve_after, the user needs to add a `:copy' argument > to that fileinto command or a `keep;' action should be executed. > > Administrator policies that always need to be executed must be placed > in a sieve_before script. > > For more information: > > [1]: https://tools.ietf.org/html/rfc5228#section-4.3 > [2]: https://tools.ietf.org/html/rfc5228#section-2.10.2 > [3]: https://tools.ietf.org/html/rfc3894 > [4]: http://tools.ietf.org/html/draft-degener-sieve-multiscript-00 > > Regards, > > Stephan. >Thanks Stephan, However still have one small issue: fileter.sieve ========= # rule:[amavis] if anyof (address :contains "From" "amavis", address :contains "Cc" "amavis-users at amavis.org", address :contains "To" "amavis-users at amavis.org") { fileinto "INBOX.lists.amavisd-new"; } # rule:[xxx_gmail] elsif anyof (header :contains "From" "xxx at gmail") { setflag "\\Flagged"; fileinto "INBOX.Gmail"; keep; } In this case, both all 3 sieve are executed: global one + filters + vacation. But as side note: when mail come from gmail account, - 1st message is sent to inbox.gmail - 2nd vacation response is sent -3rd message is copied once more directly into INBOX Now, if I modify: fileinto :copy INBOX.Gmail; The message is sent to INBOX.Gmail and also copied to INBOX How can I avoid such behavior ?