[Feature] Introduce sender-blacklists (on both global/admin and user level) - #2694
chrisblech wants to merge 23 commits into
Conversation
|
Please move the management of the ForbiddenEnvelopeSender into a separate file that can be tested and called from other places instead of adding more code to the settings page. |
|
Also there are no tests for per-user entry, regex validation on entry or deletion. |
…fixes Feature/user blacklists review fixes
|
@acasajus thank you for your valuable feedback. I tried to address all your suggestions, hoping there is nothing left and this PR can find its way into this gerat product :-) |
|
Hi @acasajus @cquintana92 ! Just a friendly follow-up on this PR. I have addressed all review comments and updated the implementation accordingly. Since then, the PR has been waiting for a while, so I wanted to ask whether there are still any concerns or if anything else is needed before this can be considered for merging. I've been running this change in my own self-hosted instance for some time now, and it has significantly reduced the amount of spam reaching my mailbox. As mentioned in the PR description, the feature is completely optional and does not change the default behaviour for existing users. If there are any additional changes, refactoring, tests or documentation updates that would make this PR easier to merge, I'd be happy to work on them. Thanks again for taking the time to review it. |
This reverts commit bfb269a.
Replaces the earlier 'reorder migrations' approach, which reused the existing revision IDs b7c1d6a4f2e1/9c2a7f3c1b21 with a different down_revision. That silently no-ops on any deployment already stamped at 9c2a7f3c1b21 (i.e. prod), skipping 4a9f8c2e1b3d's schema changes. This adds a dedicated merge revision instead, per Alembic's documented mechanism for divergent heads.
d3063cc to
d7f3168
Compare
While using a self-hosted instance für some months now with a throughput of more than 5000 mails/month and consequently manually disabling spam-sender (on contact level), simplelogin blocks about 600 SPAM mails per month.
When looking at the remaining 350 spam mails that are still forwarded to my inbox (and get caught by GMails SPAM sensor), I realize that a significant amount of them belongs to "spammer-domains" or at least follow the same pattern.
This PR adds two levels of sender blacklists to SimpleLogin: Admin and Users can use this to block sender addresses (or whole domains / TLDs) by regex pattern.
global_sender_blacklist(pattern regex + enabled + comment)Migration and tests are included.
[Bonus/Example] My personal blacklist patterns:
@novastek\.homes$@devalser\.hair$@tabot\.com\.tr$@casang\.vip$^[a-z]+[0-9]{5}@[a-z]+\.[a-z]+\.shop$@juntadeandalucia\.es$@resend\.dev$