]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Update regexp for R_UNDISC_RCPT 3576/head
authorAnton Yuzhaninov <citrin+git@citrin.ru>
Mon, 14 Dec 2020 19:31:22 +0000 (19:31 +0000)
committerAnton Yuzhaninov <citrin+git@citrin.ru>
Mon, 14 Dec 2020 19:31:22 +0000 (19:31 +0000)
Match more variations for undisclosed-recipients, but don't match when
it is used as a lame real name.

rules/regexp/headers.lua

index b760b802e345683188c368bd86cb6a175c735aad..c47205fea9dd8d6a7ae85cb3864b4b49d4f37f45 100644 (file)
@@ -106,9 +106,17 @@ reconf['MISSING_TO'] = {
 }
 
 -- Detects undisclosed recipients
-local undisc_rcpt = 'To=/^<?undisclosed[- ]recipient/Hi'
 reconf['R_UNDISC_RCPT'] = {
-  re = string.format('(%s)', undisc_rcpt),
+  -- match:
+  -- To: undisclosed-recipients:;
+  -- To: Undisclosed recipients:;
+  -- To: undisclosed-recipients: ;
+  -- To: <Undisclosed-Recipient:;>
+  -- To: "undisclosed-recipients (utajeni adresati)": ;
+  -- To: Undisclosed recipients:
+  -- but do not match:
+  -- Undisclosed Recipient <user@example.org>
+  re = [[To=/^[<"]?undisclosed[- ]recipients?\b.*:/i{header}]],
   score = 3.0,
   description = 'Recipients are absent or undisclosed',
   group = 'headers',