commit 2a7b9b3: [Minor] Update headers used by subscribe.ru

Anton Yuzhaninov citrin+git at citrin.ru
Sat Aug 8 14:42:07 UTC 2020


Author: Anton Yuzhaninov
Date: 2020-08-08 10:27:42 +0100
URL: https://github.com/rspamd/rspamd/commit/2a7b9b37d54a6d52d12e459237513c66ce853019

[Minor] Update headers used by subscribe.ru
Notably Precedence header no longer used and web links use https.
While here improve style.

---
 src/plugins/lua/maillist.lua | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/src/plugins/lua/maillist.lua b/src/plugins/lua/maillist.lua
index 252cdd436..79c457662 100644
--- a/src/plugins/lua/maillist.lua
+++ b/src/plugins/lua/maillist.lua
@@ -122,45 +122,39 @@ local function check_ml_mailman(task)
 end
 
 -- Subscribe.ru
--- Precedence: normal
--- List-Id: <.*.subscribe.ru>
--- List-Help: <http://subscribe.ru/catalog/.*>
--- List-Subscribe: <mailto:.*-sub at subscribe.ru>
--- List-Unsubscribe: <mailto:.*-unsub at subscribe.ru>
--- List-Archive:  <http://subscribe.ru/archive/.*>
--- List-Owner: <mailto:.*-owner at subscribe.ru>
+-- List-Id: <*.subscribe.ru>
+-- List-Help: <https://subscribe.ru/catalog/*>
+-- List-Subscribe: <mailto:*-sub at subscribe.ru>
+-- List-Unsubscribe: <mailto:*-unsub at subscribe.ru>
+-- List-Archive:  <https://subscribe.ru/archive/*>
+-- List-Owner: <mailto:*@subscribe.ru>
 -- List-Post: NO
 local function check_ml_subscriberu(task)
   -- List-Id
   local header = task:get_header('list-id')
-  if not header or not string.find(header, '^<.*%.subscribe%.ru>$') then
-    return false
-  end
-  -- Precedence
-  header = task:get_header('precedence')
-  if not header or not string.match(header, '^normal$') then
+  if not (header and header:find('^<.*%.subscribe%.ru>$')) then
     return false
   end
   -- Other headers
   header = task:get_header('list-archive')
-  if not header or not string.find(header, '^<http://subscribe.ru/archive/.*>$') then
+  if not (header and header:find('^<https?://subscribe%.ru/archive/.+>$')) then
     return false
   end
   header = task:get_header('list-owner')
-  if not header or not string.find(header, '^<mailto:.*-owner at subscribe.ru>$') then
+  if not (header and header:find('^<mailto:.+ at subscribe%.ru>$')) then
     return false
   end
   header = task:get_header('list-help')
-  if not header or not string.find(header, '^<http://subscribe.ru/catalog/.*>$') then
+  if not (header and header:find('^<https?://subscribe%.ru/catalog/.+>$')) then
     return false
   end
   -- Subscribe and unsubscribe
   header = task:get_header('list-subscribe')
-  if not header or not string.find(header, '^<mailto:.*-sub at subscribe.ru>$') then
+  if not (header and header:find('^<mailto:.+-sub at subscribe%.ru>$')) then
     return false
   end
   header = task:get_header('list-unsubscribe')
-  if not header or not string.find(header, '^<mailto:.*-unsub at subscribe.ru>$') then
+  if not (header and header:find('^<mailto:.+-unsub at subscribe%.ru>$')) then
     return false
   end
 


More information about the Commits mailing list