From c36d99475cb7b937e56f654b76f3d62f590acc6c Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Fri, 20 Dec 2024 22:10:55 +0800 Subject: [PATCH] Prevent sending mail to the sender themselves --- src/lists.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lists.lua b/src/lists.lua index b0f1551..a786c53 100644 --- a/src/lists.lua +++ b/src/lists.lua @@ -78,12 +78,14 @@ mail.register_recipient_handler(function(sender, name) local list_dest = {} if list_name == "admins" or list_name == "moderators" then for k, v in pairs(list_admins) do - list_dest[#list_dest+1] = k + if k ~= sender then + list_dest[#list_dest+1] = k + end end if list_name == "moderators" then for k, v in pairs(list_moderators) do - if list_name ~= "admins" or not list_admins[k] then + if k ~= sender and (list_name ~= "admins" or not list_admins[k]) then list_dest[#list_dest+1] = k end end