spamassassin-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David B Funk <dbf...@engineering.uiowa.edu>
Subject Re: regexp dealing with display name don't work
Date Fri, 27 Apr 2018 20:09:01 GMT
On Fri, 27 Apr 2018, Joƫlle Pfeffer wrote:

> I have progressed.
> 
> If my rule is
> header REGLE_HF002 From:name =~ /@A/i
> 
> e-mails containing
> From: @A <jopfeffer@free.fr>
> or
> From: "@AB" <jopfeffer@free.fr>
> or
> From: "@Ab" <jopfeffer@free.fr>
> are not blocked
> 
> but if my rule is
> header REGLE_HF002 From:name =~ /@.b/i
> 
> e-mails containing
> From: "@Ab" <jopfeffer@free.fr>
> or
> From: "@ABc" < jopfeffer@free.fr >
> are blocked
[snip..]

If you want to match a literal '@' in a SA regex you need to escape it.
Try:
   header REGLE_HF002 From:name =~ /\@a/i

(note the trailing 'i' makes the regex be case-insenstive so /\@A/i doesn't make 
sense).


-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{
Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message