summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/maillist.lua
diff options
context:
space:
mode:
authorAnton Yuzhaninov <citrin+git@citrin.ru>2020-08-08 10:27:42 +0100
committerAnton Yuzhaninov <citrin+git@citrin.ru>2020-08-08 10:27:42 +0100
commit2a7b9b37d54a6d52d12e459237513c66ce853019 (patch)
treeb8a7e41cf6ddc88dfc04686a52d774e99e3d80d5 /src/plugins/lua/maillist.lua
parent1c7d251741b58f976f7fbb2a03bd8369311cbdbd (diff)
downloadrspamd-2a7b9b37d54a6d52d12e459237513c66ce853019.tar.gz
rspamd-2a7b9b37d54a6d52d12e459237513c66ce853019.zip
[Minor] Update headers used by subscribe.ru
Notably Precedence header no longer used and web links use https. While here improve style.
Diffstat (limited to 'src/plugins/lua/maillist.lua')
-rw-r--r--src/plugins/lua/maillist.lua30
1 files 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@subscribe.ru>
--- List-Unsubscribe: <mailto:.*-unsub@subscribe.ru>
--- List-Archive: <http://subscribe.ru/archive/.*>
--- List-Owner: <mailto:.*-owner@subscribe.ru>
+-- List-Id: <*.subscribe.ru>
+-- List-Help: <https://subscribe.ru/catalog/*>
+-- List-Subscribe: <mailto:*-sub@subscribe.ru>
+-- List-Unsubscribe: <mailto:*-unsub@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@subscribe.ru>$') then
+ if not (header and header:find('^<mailto:.+@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@subscribe.ru>$') then
+ if not (header and header:find('^<mailto:.+-sub@subscribe%.ru>$')) then
return false
end
header = task:get_header('list-unsubscribe')
- if not header or not string.find(header, '^<mailto:.*-unsub@subscribe.ru>$') then
+ if not (header and header:find('^<mailto:.+-unsub@subscribe%.ru>$')) then
return false
end