Hi
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the
fileinto
wrong?
Using dovecot-pigeonhole-2.2.36-8.el7.x86_64
On 23-08-2022 11:44, João Silva wrote:
Hi
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the
fileinto
wrong?
Using dovecot-pigeonhole-2.2.36-8.el7.x86_64
I use it like this, and it works for me:
if address :is "From" "sender@domain" { fileinto :create "some_mail_folder"; stop; }
Almost 20 years ago, I figured out that I *need* the "stop;" line, but I don't remember why.
-- Rob
On 23/08/2022 13:03, Rob Sterenborg (Lists) wrote:
On 23-08-2022 11:44, João Silva wrote:
Hi
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the
fileinto
wrong?
Using dovecot-pigeonhole-2.2.36-8.el7.x86_64
I use it like this, and it works for me:
if address :is "From" "sender@domain" { fileinto :create "some_mail_folder"; stop; }
Almost 20 years ago, I figured out that I *need* the "stop;" line, but I don't remember why.
The stop; is needed to prevent further script actions on the email and that is a very curious thing that I dont know if falls in the "bug or feature" field.
if I use
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac";
keep;
}
It delivers the mail in my Inbox which was my intention in the first place.
When I used the filter without the keep; and since I didn't had the stop; I was expecting further actions on that email that will lead to the email end up in the Inbox and that didn't happened.
So it apears that the fileinto rule have a stop; into it without the stop being declared.
In a complex mail management scenario that can cause problems. So my question is, "bug or feature"?
-- Rob
I recommend reading the RFC: 2.10.2 https://www.rfc-editor.org/rfc/rfc5228#section-2.10.2 is where the Implicit Keep is described.
Basically, if you don’t take action on a message, there is an “implicit keep” that will save the mail in the default location. If an action *is* taken on a message (that results in it being saved somewhere; i.e., ‘fileinto’), then the implicit keep is removed (since you have explicitly said where to put it).
So there’s the “keep” keyword (see 4.3 https://www.rfc-editor.org/rfc/rfc5228#section-4.3), to “do what you would do in the implicit keep” (more or less).
So:
fileinto :create “ac” -> puts the message into “ac” and removes “implicit keep” keep -> puts implicit keep back (more or less)
fileinto :copy :create “ac” -> puts a *COPY* of the message into “ac”, and the original retains “implicit keep”.
They do the same thing, though I try and avoid unnecessary extensions when I can.
Sean
On Aug 24, 2022, at 07:29, João Silva joaopfmlist@lipc.fis.uc.pt wrote:
On 23/08/2022 13:03, Rob Sterenborg (Lists) wrote:
On 23-08-2022 11:44, João Silva wrote:
Hi
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the
fileinto
wrong?
Using dovecot-pigeonhole-2.2.36-8.el7.x86_64
I use it like this, and it works for me:
if address :is "From" "sender@domain" { fileinto :create "some_mail_folder"; stop; }
Almost 20 years ago, I figured out that I *need* the "stop;" line, but I don't remember why.
The stop; is needed to prevent further script actions on the email and that is a very curious thing that I dont know if falls in the "bug or feature" field.
if I use
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac";
keep;
}
It delivers the mail in my Inbox which was my intention in the first place.
When I used the filter without the keep; and since I didn't had the stop; I was expecting further actions on that email that will lead to the email end up in the Inbox and that didn't happened.
So it apears that the fileinto rule have a stop; into it without the stop being declared.
In a complex mail management scenario that can cause problems. So my question is, "bug or feature"?
-- Rob
Thanks for the detailed anwser.
So it falls under the "feature" section. I will keep that in mind in future sieves.
And I think you are right, :copy only makes sense in situations where the flow can lead to other places than the Inbox.
On 24/08/2022 20:04, Sean Kamath wrote:
I recommend reading the RFC: 2.10.2 https://www.rfc-editor.org/rfc/rfc5228#section-2.10.2 is where the Implicit Keep is described.
Basically, if you don’t take action on a message, there is an “implicit keep” that will save the mail in the default location. If an action *is* taken on a message (that results in it being saved somewhere; i.e., ‘fileinto’), then the implicit keep is removed (since you have explicitly said where to put it).
So there’s the “keep” keyword (see 4.3 https://www.rfc-editor.org/rfc/rfc5228#section-4.3), to “do what you would do in the implicit keep” (more or less).
So:
fileinto :create “ac” -> puts the message into “ac” and removes “implicit keep” keep -> puts implicit keep back (more or less)
fileinto :copy :create “ac” -> puts a *COPY* of the message into “ac”, and the original retains “implicit keep”.
They do the same thing, though I try and avoid unnecessary extensions when I can.
Sean
On Aug 24, 2022, at 07:29, João Silva joaopfmlist@lipc.fis.uc.pt wrote:
On 23/08/2022 13:03, Rob Sterenborg (Lists) wrote:
On 23-08-2022 11:44, João Silva wrote:
Hi
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the
fileinto
wrong?
Using dovecot-pigeonhole-2.2.36-8.el7.x86_64
I use it like this, and it works for me:
if address :is "From" "sender@domain" { fileinto :create "some_mail_folder"; stop; }
Almost 20 years ago, I figured out that I *need* the "stop;" line, but I don't remember why.
The stop; is needed to prevent further script actions on the email and that is a very curious thing that I dont know if falls in the "bug or feature" field.
if I use
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac";
keep;
}
It delivers the mail in my Inbox which was my intention in the first place.
When I used the filter without the keep; and since I didn't had the stop; I was expecting further actions on that email that will lead to the email end up in the Inbox and that didn't happened.
So it apears that the fileinto rule have a stop; into it without the stop being declared.
In a complex mail management scenario that can cause problems. So my question is, "bug or feature"?
-- Rob
On 8/23/22 03:44, João Silva wrote:
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the fileinto wrong?
I just took a look at my fairly extensive sieve script that has been built by the managesieve plugin for the roundcube webmail server. I don't often look at the script itself because that plugin lets me edit the script in a GUI.
The fileinto command is used in almost every one of my rules. It is not copying the message, it is moving the message to the destination folder. Here is one of my rules:
# rule:[blog] if header :contains ["To","cc"] "blog@elyograg.org" { fileinto "admin.blog"; stop; }
There is an extension to sieve that adds a :copy option to certain commands like fileinto for situations where that is actually what you want to do. Pigeonhole does support it:
https://www.rfc-editor.org/rfc/rfc3894.html
Thanks, Shawn
Thanks a lot.
I almost missed your email. The :copy will make it behave like intended.
On 23/08/2022 20:29, Shawn Heisey wrote:
On 8/23/22 03:44, João Silva wrote:
If a sieve filter contains a rule
if header :regex ["From"] ["@xxx.com","@yyy.pt"] { fileinto :create "ac"; }
The mail should be copied to the folder ac and then proceed to other rules that a user might have or I understood the fileinto wrong?
I just took a look at my fairly extensive sieve script that has been built by the managesieve plugin for the roundcube webmail server. I don't often look at the script itself because that plugin lets me edit the script in a GUI.
The fileinto command is used in almost every one of my rules. It is not copying the message, it is moving the message to the destination folder. Here is one of my rules:
# rule:[blog] if header :contains ["To","cc"] "blog@elyograg.org" { fileinto "admin.blog"; stop; }
There is an extension to sieve that adds a :copy option to certain commands like fileinto for situations where that is actually what you want to do. Pigeonhole does support it:
https://www.rfc-editor.org/rfc/rfc3894.html
Thanks, Shawn
participants (4)
-
João Silva
-
Rob Sterenborg (Lists)
-
Sean Kamath
-
Shawn Heisey