[Rspamd-Users] Regexp rules

Steve Witten caponecicero at gmail.com
Sun Feb 12 17:35:42 UTC 2023


I have the following regexp rule:

local regexconf = config['regexp'] -- Create alias for regexp configs
> local re = '/[sS][tT][aA][nN][sS][bB][eE][rR][rR][yY]/RM'
> regexconf['X_STANSBERRY'] = {
>         re = string.format('(%s)', re), -- use string.format to create
> expression
>         score = 15.0,
>         description = 'Reject email from Porter Stansberry (finance
> wackadoodle).',
>         condition = function(task) -- run this rule only if some condition
> is satisfied
>                 return true
>         end,
> }


that I wrote according to the manual section covering such matters.

The above rule works.  My question is about the regexp...  Is there any way
I can specify the regexp as */stansberry/i* (like I would do in perl)
instead of the cumbersome form used above.

Thanks in advance...

-- Steve

P.S.  For those of you not in the know, Porter Stansberry is a stock-market
wackadoodle who thinks that the Apocalypse is any minute now...and spams
the world accordingly.  He's been slapped down by the SEC and the FTC (US
government agencies) several times over this.

>


More information about the Users mailing list