Hello Martin,
On 2020-09-09 14:33, Martin Nadvornik wrote:
I recently discovered that archiving rules like "From:
[email protected]" or "To: [email protected]" will also trigger
for e-mail addresses like "[email protected]". Is there any way
to perform an exaxct matching?
I already tried entering the following regexes when creating the rules
via the web gui:
"[email protected]"
^ [email protected]
^[email protected]
Any help is appreciated :)
Take a message as an eml file, and run pilertest against it to see how
piler sees the message. Only showing the To: results between asterisks
(*).
Let's take the following message (#1) (only the To: header):
To: [email protected]
after parsing:
to: *[email protected] user name example com (example.com )*
Then another message (#2):
To: "User, Name" [email protected]
after parsing:
to: *user name [email protected] user name example com (example.com
)*
If you specified "^[email protected]" (without quotes), then you
could match
message #1, but miss #2.
If you specified "[email protected]" (without quotes), then you
could match
both message #1 and #2, however also match [email protected],
which you
don't want.
So the solution takes 2 patterns:
"^[email protected]" to catch #1
and
" [email protected]" to catch #2 (notice the prepended space!)
Again, you shouldn't use the quotes when you type these patterns, the
quotes
here only serve as a clear distinction.
Janos