Sieve fileinto :create is failing
I’m trying to get a sieve script to move messages into a folder, and to create that folder if it doesn’t already exist. I’m following the example code at:
https://doc.dovecot.org/configuration_manual/sieve/examples/
and doing this:
require ["fileinto", "mailbox”]; … fileinto :create “myfolder”; …
That results in this error in the log file:
error: unknown tagged argument ':create' for the fileinto command
What am I doing wrong?
rg
On 19/01/2021 19:45 Ron Garret <ron@flownet.com> wrote:
I’m trying to get a sieve script to move messages into a folder, and to create that folder if it doesn’t already exist. I’m following the example code at:
https://doc.dovecot.org/configuration_manual/sieve/examples/
and doing this:
require ["fileinto", "mailbox”]; … fileinto :create “myfolder”; …
That results in this error in the log file:
error: unknown tagged argument ':create' for the fileinto command
What am I doing wrong?
rg
Which version of dovecot/pigeonhole is this?
I tested this with 2.3.13 and it worked just fine. Are those quotes mangled by your mailer or do you really have some fancy quotes in your sieve script?
Aki
On Jan 19, 2021, at 10:40 PM, Aki Tuomi <aki.tuomi@open-xchange.com> wrote:
On 19/01/2021 19:45 Ron Garret <ron@flownet.com> wrote:
I’m trying to get a sieve script to move messages into a folder, and to create that folder if it doesn’t already exist. I’m following the example code at:
https://doc.dovecot.org/configuration_manual/sieve/examples/
and doing this:
require ["fileinto", "mailbox”]; … fileinto :create “myfolder”; …
That results in this error in the log file:
error: unknown tagged argument ':create' for the fileinto command
What am I doing wrong?
rg
Which version of dovecot/pigeonhole is this?
I’m not sure. How would I find out? I just installed it on Debian using apt.
I tested this with 2.3.13 and it worked just fine. Are those quotes mangled by your mailer or do you really have some fancy quotes in your sieve script?
Not sure what you mean by “fancy quotes”. The quotes I have (and the ones I see in your quoted message) are regular ascii double quotes, code point 0x22.
But I think it is actually working now. I didn’t change anything, it just seems to have spontaneously started working. Maybe sieve was working off an earlier version of the script that it had cached?
rg
On 20/01/2021 08:46 Ron Garret <ron@flownet.com> wrote:
On Jan 19, 2021, at 10:40 PM, Aki Tuomi <aki.tuomi@open-xchange.com> wrote:
On 19/01/2021 19:45 Ron Garret <ron@flownet.com> wrote:
I’m trying to get a sieve script to move messages into a folder, and to create that folder if it doesn’t already exist. I’m following the example code at:
https://doc.dovecot.org/configuration_manual/sieve/examples/
and doing this:
require ["fileinto", "mailbox”]; … fileinto :create “myfolder”; …
That results in this error in the log file:
error: unknown tagged argument ':create' for the fileinto command
What am I doing wrong?
rg
Which version of dovecot/pigeonhole is this?
I’m not sure. How would I find out? I just installed it on Debian using apt.
I tested this with 2.3.13 and it worked just fine. Are those quotes mangled by your mailer or do you really have some fancy quotes in your sieve script?
Not sure what you mean by “fancy quotes”. The quotes I have (and the ones I see in your quoted message) are regular ascii double quotes, code point 0x22.
But I think it is actually working now. I didn’t change anything, it just seems to have spontaneously started working. Maybe sieve was working off an earlier version of the script that it had cached?
rg
Ok. Sieve (re)compiles scripts when it sees that they change (comparing file dates). It does not cache scripts in memory.
Aki
I think I figured out what happened. I think I edited the .sieve file but forgot to save it, so I was actually running an old version that did not have “mailbox” in the require statement.
On which note, two more questions:
Is there any documentation about what “requires” are needed to access various features? The only source I’ve found for this is reverse-engineering examples.
Is there a way to change the location of the sieve logfile that gets created when a sieve script produces an error? Right now it ends up in the same directory as the script, but I’d prefer to have in /var/log along with everything else.
rg
On Jan 19, 2021, at 11:02 PM, Aki Tuomi <aki.tuomi@open-xchange.com> wrote:
On 20/01/2021 08:46 Ron Garret <ron@flownet.com> wrote:
On Jan 19, 2021, at 10:40 PM, Aki Tuomi <aki.tuomi@open-xchange.com> wrote:
On 19/01/2021 19:45 Ron Garret <ron@flownet.com> wrote:
I’m trying to get a sieve script to move messages into a folder, and to create that folder if it doesn’t already exist. I’m following the example code at:
https://doc.dovecot.org/configuration_manual/sieve/examples/
and doing this:
require ["fileinto", "mailbox”]; … fileinto :create “myfolder”; …
That results in this error in the log file:
error: unknown tagged argument ':create' for the fileinto command
What am I doing wrong?
rg
Which version of dovecot/pigeonhole is this?
I’m not sure. How would I find out? I just installed it on Debian using apt.
I tested this with 2.3.13 and it worked just fine. Are those quotes mangled by your mailer or do you really have some fancy quotes in your sieve script?
Not sure what you mean by “fancy quotes”. The quotes I have (and the ones I see in your quoted message) are regular ascii double quotes, code point 0x22.
But I think it is actually working now. I didn’t change anything, it just seems to have spontaneously started working. Maybe sieve was working off an earlier version of the script that it had cached?
rg
Ok. Sieve (re)compiles scripts when it sees that they change (comparing file dates). It does not cache scripts in memory.
Aki
On Wed, Jan 20, 2021 at 12:12:40PM -0800, Ron Garret wrote:
- Is there any documentation about what “requires” are needed to access various features? The only source I’ve found for this is reverse-engineering examples.
Sieve RFCs. At least this is what I have used to learn sieve. Each extension to basic language needs a specific keyword in require statement. List of supported extensions with links to RFCs is on the wiki:
https://wiki.dovecot.org/Pigeonhole/Sieve
- Is there a way to change the location of the sieve logfile that gets created when a sieve script produces an error? Right now it ends up in the same directory as the script, but I’d prefer to have in /var/log along with everything else.
plugin { sieve_user_log = <path> }
It's per-user and written with logged-in user rights, so you probably wan't be able to put it in /var/log unless you use some clever permissions setup, depending on how you run imap processes. I don't know if it supports %u expansion or something.
-- Piotr "Malgond" Auksztulewicz firstname@lastname.net
On Jan 20, 2021, at 12:32 PM, Piotr Auksztulewicz <dcml@hasiok.net> wrote:
On Wed, Jan 20, 2021 at 12:12:40PM -0800, Ron Garret wrote:
- Is there any documentation about what “requires” are needed to access various features? The only source I’ve found for this is reverse-engineering examples.
Sieve RFCs.
I was afraid of that :-(
plugin { sieve_user_log = <path> }
It's per-user and written with logged-in user rights, so you probably wan't be able to put it in /var/log unless you use some clever permissions setup, depending on how you run imap processes. I don't know if it supports %u expansion or something.
I’m only using global sieve scripts, but that’s a good point.
Thanks!
rg
On 20/01/2021 22:37 Ron Garret <ron@flownet.com> wrote:
On Jan 20, 2021, at 12:32 PM, Piotr Auksztulewicz <dcml@hasiok.net> wrote:
On Wed, Jan 20, 2021 at 12:12:40PM -0800, Ron Garret wrote:
- Is there any documentation about what “requires” are needed to access various features? The only source I’ve found for this is reverse-engineering examples.
Sieve RFCs.
I was afraid of that :-(
Or if you don't feel like trolling the sieve RFCs too much, you can also start with https://doc.dovecot.org/configuration_manual/sieve/
There is also https://wiki2.dovecot.org/Pigeonhole/Sieve/ which has this handy list of all recognized extensions.
Aki
On 20 Jan 2021, at 13:12, Ron Garret <ron@flownet.com> wrote:
- Is there any documentation about what “requires” are needed to access various features? The only source I’ve found for this is reverse-engineering examples.
This list an the RFCs.
- Is there a way to change the location of the sieve logfile that gets created when a sieve script produces an error? Right now it ends up in the same directory as the script, but I’d prefer to have in /var/log along with everything else.
Sieve is per user, so you cannot write the logs to /var/log/
And it does not matter if you are running global script, as I learned recently, the logs are written per user no matter what.
-- <[TN]FBMachine> I got kicked out of Barnes and Noble once for moving all the bibles into the fiction section
participants (4)
-
@lbutlr
-
Aki Tuomi
-
Piotr Auksztulewicz
-
Ron Garret