Initial implementation of spam check

It checks during the sends if there are spam warnings then give to the message an attribute spam=true (only for receivers)
This commit is contained in:
Athozus 2023-12-24 15:44:29 +01:00
parent 75510d2551
commit bfe0ef2711
4 changed files with 44 additions and 0 deletions

View file

@ -83,6 +83,7 @@ function mail.send(m)
local entry = mail.get_storage_entry(m.from)
table.insert(entry.outbox, 1, msg)
mail.set_storage_entry(m.from, entry)
msg.spam = #mail.check_spam(msg) >= 1
-- add in every receivers inbox
for recipient in pairs(recipients) do