Hey
Okay, I finally found the sieve file. And the filters, they are broken. No
wonder it's not working.
>From the file:
if anyof (address :regex :comparator "i;octet" "from"
“.*@(bergportal\\.ch|freezetag\\.com|garmin\\.com|geocaching\\.com|komoot\\.de|munzee\\.com|quaeldich\\.de|spontacts\\.com|squadrats\\.com|strava\\.com|update\\.strava\\.com|velocity\\.ch|wandrer\\.earth)$”)
{
fileinto "Social Networks/🏔🚴 Draussen";
}
That's verbatim how it looks like and that's of course wrong. Why in the world
would it escape the “\”? It must be left alone.
In the UI, I entered:
.*@(bergportal\.ch|freezetag\.com|garmin\.com|geocaching\.com|komoot\.de|munzee\.com|quaeldich\.de|spontacts\.com|squadrats\.com|strava\.com|update\.strava\.com|velocity\.ch|wandrer\.earth)$
For the last entry, it means: “wandrer” followed by EXACTLY the char “.”
followed by “earth”.
Now, with whatever SOGo did, it came out as: wandrer\\.earth
That's “wandrer” followed by “\.” (backslash dot) followed by “earth”.
That's broken.
No wonder it's not working.
I'm using mailcow 2025-03 and SOGo that comes with it (v5.11.2).
Now, I could of course write in the filter condition:
…|wandrer.earth)$
That WOULD be left alone, but that's wrong. It would mean “wandrer” followed by
any char followed by “earth”.
--
Alexander
--
Complete contact details at https://a.skwar.xyz/
On Tuesday, 25. March 2025 17:01 CET, "qhivert" ([email protected])
<[email protected]> wrote:
Hello,
I’ve just tested your first filter with all the conditions and this work well.
To be sure, can you get the sieve script generated by sogo? And see if what’s
in there match your filter.
Quentin
From: [email protected] <[email protected]> On Behalf Of "Alexander
Skwar"
Sent: mardi 25 mars 2025 16:27
To: [email protected]
Subject: [SOGo] [SPAM] Regexp filter does not match
Hello
Currently trying to move from Gmail to maicow + SOGo. One of the issues I
encounter is the filtering in mailcow/SOGo.
I've got the following filter:
* Match any of the following rules
* From, matches regex,
.*@(bergportal\.ch|freezetag\.com|garmin\.com|geocaching\.com|komoot\.de|munzee\.com|quaeldich\.de|spontacts\.com|squadrats\.com|strava\.com|update\.strava\.com|velocity\.ch|wandrer\.earth)$
* To or Cc, matches regex,
hiking-buddies@dom1\.rodeo|carving\.fleshed313@dom2\.vip|com\+wandrer\[email protected]|squadrats\.com@dom1\.rodeo
* From, contains, [email protected]
* Actions
* File the message in, 🏔🚴 Draussen
However, it does not work. But why? Are there logs somewhere?
It should match - I'm looking for “From” “matches” "…freezetag\.com
$ grep -i freezetag\.com ~/tmp/message-headers-freezetag.txt
dkim=pass header.d=freezetag.com header.s=k3 header.b=PLkik2a8;
dmarc=pass (policy=none) header.from=freezetag.com
dkim=pass header.d=freezetag.com header.s=k3 header.b=PLkik2a8;
dmarc=pass (policy=none) header.from=freezetag.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freezetag.com; s=k3;
t=1742915017; x=1743185017; [email protected];
From: Munzee Gardening Club <[email protected]>
Reply-To: =?utf-8?Q?Munzee=20Gardening=20Club?= <[email protected]>
FORGED_SENDER(0.30)[[email protected],bounce-mc.us10_38846137.13528275-b55424b...@mail86.atl111.rsgsv.net];
R_DKIM_ALLOW(0.00)[freezetag.com:s=k3];
DMARC_POLICY_ALLOW(0.00)[freezetag.com,none];
FROM_NEQ_ENVFROM(0.00)[[email protected],bounce-mc.us10_38846137.13528275-b55424b...@mail86.atl111.rsgsv.net];
HAS_REPLYTO(0.00)[[email protected]];
DKIM_TRACE(0.00)[freezetag.com:+];
I'll attach the complete headers.
Any ideas about why it does not work? How can I test this?
I would have thought it might be, because I'm doing “.*@freezetag.com$”, ie.
freezetag.com must be at the end of the line. But in the “From:” line, there's
the “>” after “freezetag.com”.
BUT… I've got a different filter with this rule:
* From, matches re, .*@(company\.com|name1\.me|name2\.one)$
And this DOES work. It matched an email with this from line in the headers:
From: Alexander Skwar <[email protected]>
There was also a “>” at the end (which there will almost always be; at least
if there's a “real name” and if it's not using the outdated syntax of
“[email protected] (real name)”).
Help would be immensely appreciated for getting filters with regexps to work.
Thanks a lot,
Alexander
--
Complete contact details at https://a.skwar.xyz/