Skip to content

mod_antispam: initial import from ejabberd-contrib/mod_spam_filter #4373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sstrigler
Copy link
Contributor

@sstrigler sstrigler commented Apr 17, 2025

At that point this is very preliminary. Missing

  • tests
    Not sure where to add tests. Would be a major but rewarding effort. Please advice!
  • documentation
    Add documentation for mod_antispam docs.ejabberd.im#136 - for current status
  • merge mod_muc_rtbl (maybe)
    Otherwise we'd have to configure RTBL hosts in different places. Also code-wise we would avoid duplicate functionality and avoid differing behavior

Current config:

modules:
 [...]
  mod_antispam:
    rtbl_host: "xmppbl.org"
    rtbl_domains_node: "spam_source_domains"
    spam_domains_file: "/etc/ejabberd/spam-filter/domains.txt"
    spam_jids_file: "/etc/ejabberd/spam-filter/jids.txt"
    spam_urls_file: "/etc/ejabberd/spam-filter/urls.txt"
    spam_dump_file: "/var/log/ejabberd/spam_dump.log"
    access_spam:
      allow:
        user: honeypot@example.org

If mod_muc_rtbl's functionality were to be merged into this module that config might need to change, especially wrt either have just one or more rtbl hosts.

Proposed change:

modules:
  [...]
  mod_antispam:
    rtbl_hosts:
      - xmppbl.org:
        - spam_source_domains
        - muc_bans_sha256
      - rtbl.example.org:
        - spam_source_domains: custom_node
    rtbl_policy:
      spam_source_domains: more_than_one
      muc_bans_sha256: one

Possible rtbl_policy values are one|more_than_one|all. Ideas?

@sstrigler
Copy link
Contributor Author

I had plans to remove the gen_server in this code and instead just use ets tables. Would make the code easier to navigate since you wouldn't have to jump between different places. But then, keeping the fd for the dump file requires a gen_server, that's why I stuck with it for now.

@coveralls
Copy link

coveralls commented Apr 17, 2025

Coverage Status

coverage: 33.238% (-0.3%) from 33.58%
when pulling 94d008a on sstrigler:mod_antispam
into ef75493 on processone:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants