Viktor Ustiuhov via Exim-users <exim-users@lists.exim.org> (So 23 Feb 2025 11:49:10 CET): > Heiko Schlittermann via Exim-users wrote on 23.02.2025 11:13: > > > > X-Bogosity: Spam, tests=bogofilter, spamicity=1.000000, version=1.2.5\r\n > > |<---- $h_x-bogosity: --------------------------------->| > > |<----- $rh_x-bogosity: ------------------------------------>| > > > > > > No need to check for the space before spam, > > I prefer to explicitly specify the pattern for whitespace characters in > case in the future for some reason I replace $h_X-Bogosity: with > $rh_X-Bogosity: and forget to add \s or a space to the regex.
Hm, debatable, as you then have to check for possible encoding too. > > but better check for the > > comma terminating that word. I suggest > > > > match{$h_x-bogosity:}{(?i)^spam,} > > In such cases, I prefer to use \b in case the syntax changes in the > header value. Good point. > > We have ${address:<string>}, so e.g. ${address:$h_from:}, which extracts > > the address. > > Try to check ${address:$h_From:} for > > From: mailb...@domain.tld <mailb...@domain.tld> That is in invalid from header value. If I'm not mistaken, then, per RFC5322, an unquoted display name must not contain "@". > > Parsing the header with the expression above is likely > > going to fail in allowed but not probably covered edge cases. (Though I > > wasn't able to construct one yet.) > > Please, show me such cases. exim -be '${sg{${sg{"h...@foobar.com" <hans @ example.com>}{:}{\\\\:}}}{\N^\s*\S+@\S+\s*(<\S+@\S+>)\N}{\$1}}' "h...@foobar.com" <hans @ example.com> So it doesn't extract the address, but it returns something ${domain:<string>} can extract a domain from. If that is your intention, then I fail proving it being wrong :) > Try to check ${addresses:mailb...@domain.tld <mailb...@domain.tld>} Same as above - the input to ${addresses:<…>} is invalid per RFC5321. Best regards from Dresden/Germany Viele Grüße aus Dresden Heiko Schlittermann -- SCHLITTERMANN.de ---------------------------- internet & unix support - Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} - gnupg encrypted messages are welcome --------------- key ID: F69376CE -
signature.asc
Description: PGP signature
-- ## subscription configuration (requires account): ## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/ ## unsubscribe (doesn't require an account): ## exim-users-unsubscr...@lists.exim.org ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/