[Rspamd-Users] Something simple

Albrecht Backhaus albrecht.backhaus at gmail.com
Tue Apr 14 16:38:30 UTC 2020

Am 14.04.2020 18:12:45, "James B Huber" <jbh at genesis-net.net> schrieb:

>Beats me, the first line "^Shipping Address: 2270 E. Park Ave$" should
>according to regex (or my understanding of it) be an "exact & complete"
>match, which is what I out in the body of the test message..
>FWIW I tried that:
>/^Shipping Address: 2270 E. Park Ave$/
>and it still didn't get a hit...
>I also tried:
>/^Shipping Address: 2270 E. Park Ave$/ REJECT_CONTENT:10
>No luck....I know this should be like really simple...I am feeling
>awfully dumb here
>On Tue, 2020-04-14 at 17:39 +0200, Ralph Meyer via Users wrote:
>>  Hi,
>>  > /etc/rspamd/maps.d/content.map contains 3 lines, the last line
>>  > being
>>  > just a "return" or NEWLINE:
>>  > ^Shipping Address: 2270 E. Park Ave$
>>  > This_should_be_seen_jbh
>>  I'm not really sure, but shouldn't this look more like a regex ?
>>  For example :
>>  /^foo$/
>>  Not tested.
>>  Ralph
>Users mailing list
>Users at lists.rspamd.com
Hi there

Here is what the provided regex will catch and some usefull information

btw: forward slashes  (e.g. /regexpattern/) are not supported within 
hyperscan - same like in PCRE

^Shipping Address: 2270 E. Park Ave$

     ^Shipping Address: 2270 E. Park Ave$

Options: Case sensitive; Exact spacing; Dot doesn’t match line breaks; 
^$ don’t match at line breaks; Default line breaks; Numbered capture; 
Names must be unique; Greedy quantifiers; Allow zero-length matches

* [Assert position at the beginning of the string][1] `^`
* [Match the character string “Shipping Address: 2270 E” literally (case 
sensitive)][2] `Shipping Address: 2270 E`
* [Match any single character that is NOT a line break character (line 
feed)][3] `.`
* [Match the character string “ Park Ave” literally (case sensitive)][2] 
` Park Ave`
* [Assert position at the end of the string, or before the line break at 
the end of the string, if any (line feed)][1] `$`

[1]: https://www.regular-expressions.info/anchors.html
[2]: https://www.regular-expressions.info/characters.html
[3]: https://www.regular-expressions.info/dot.html

Maybe that helps

Greetings Albrecht

More information about the Users mailing list