Sieve regex behavior
Hi,
I'm having troubles lately with a Sieve script of mine:
require "fileinto";
require "mailbox";
require "regex";
if header :regex "Subject" "\\[.*PATCH.*\\]" {
fileinto :create "Inbox.Patches";
}
This should move all patches with "[PATCH]" or "[RFC PATCH v3]" into this Inbox subfolder, I'm pretty sure this version worked flawlessly in the past but since a couple of weeks ago it's not working with some emails.
Debugging this, with manually editing mail files, I came to this discovery. That one mail matches and it's getting moved to the correct folder:
Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter: A
Adding one more character leads to it not getting moved:
Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter:
Ad
Does anybody have an explanation for this why this broke, and how to fix either Dovecot/Pigeonhole or my Sieve script?
I've already lost hours trying to figure this out and I'm not getting any wiser...
Regards Luca
2.4.2 replaced libc regex(3) with libpcre2, maybe it is this?
Aki
On 07/12/2025 13:44 EET Luca Weiss via dovecot <[1]dovecot@dovecot.org>
wrote:
Hi,
I'm having troubles lately with a Sieve script of mine:
require "fileinto";
require "mailbox";
require "regex";
if header :regex "Subject" "\\[.*PATCH.*\\]" {
fileinto :create "Inbox.Patches";
}
This should move all patches with "[PATCH]" or "[RFC PATCH v3]" into
this Inbox subfolder, I'm pretty sure this version worked flawlessly in
the past but since a couple of weeks ago it's not working with some
emails.
Debugging this, with manually editing mail files, I came to this
discovery.
That one mail matches and it's getting moved to the correct folder:
Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter: A
Adding one more character leads to it not getting moved:
Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter:
Ad
Does anybody have an explanation for this why this broke, and how to fix
either Dovecot/Pigeonhole or my Sieve script?
I've already lost hours trying to figure this out and I'm not getting
any wiser...
Regards
Luca
_______________________________________________
dovecot mailing list -- [2]dovecot@dovecot.org
To unsubscribe send an email to [3]dovecot-leave@dovecot.org
References
Visible links
- mailto:dovecot@dovecot.org
- mailto:dovecot@dovecot.org
- mailto:dovecot-leave@dovecot.org
On Sun, 2025-12-07 at 16:06 +0200, Aki Tuomi via dovecot wrote:
2.4.2 replaced libc regex(3) with libpcre2, maybe it is this?
Aki
You may find it helpful to test the regex at command line. e.g.
$ pcre2test PCRE2 version 10.47 2025-10-21 (8-bit) re> '\[.*PATCH.*\]' data> 'Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter: Ad' 0: [PATCH v2 3/6] data> 'Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter: A' 0: [PATCH v2 3/6] data> '[RFC PATCH v3]' 0: [RFC PATCH v3] data> '[xxx]' No match data> 'PATCH' No match
-- Gene
On Sun, 2025-12-07 at 16:06 +0200, Aki Tuomi via dovecot wrote:
2.4.2 replaced libc regex(3) with libpcre2, maybe it is this?
Aki
You may find it helpful to test the regex at command line. e.g.
$ pcre2test PCRE2 version 10.47 2025-10-21 (8-bit) re> '\[.*PATCH.*\]' data> 'Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter: Ad'
0: [PATCH v2 3/6]
data> 'Subject: Re: [PATCH v2 3/6] arm64: dts: qcom: qcm6490-shift-otter: A' 0: [PATCH v2 3/6]
data> '[RFC PATCH v3]' 0: [RFC PATCH v3] data> '[xxx]' No match data> 'PATCH' No match
--
Gene
participants (3)
-
Aki Tuomi
-
Genes Lists
-
Luca Weiss