line endings in body tests

"Rainer Sokoll via users" <[email protected]>
Newsgroups gmane.mail.spam.spamassassin.general
Message-ID <[email protected]>
Hi,

SpamAssassin version 4.0.0
  running on Perl version 5.36.0

Debian 12 (bookworm)

I’m pulling my hair out.
A simple mail containing

------[snip]-----
teststring
some random text
------[snap]-----

and a rule in local.cf:
body TESTRULE /teststring$/
score TESTRULE 5.0

does NOT match when testing with spamassassin -t
BUT when the mail body looks like

------[snip]-----
teststring

sometext
------[snap]-----

the rule matches - why, why, why? There are no additional or hidden control characters.

body TESTRULE /^teststring/
score TESTRULE 5.0

matches in any case. spamassassin --lint does not complain.
I’m going slightly mad 🙁

Background: I want to tag all mails that have lines ending with " ." (space period), if this pattern occures at least 3 times.

I thought

------[snip]-----
body __2025030701 /\s\.$/
tflags __2025030701 multiple
meta 2025030701 __2025030701 >= 3
score 2025030701 5.0
describe 2025030701 Mindestens 3 Zeilen enden auf " ."
------[snap]-----

would do this, but I cannot get spamassassin to recognize the line endings.

Any hint is appreciated,

Rainer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.