Skip to content

Rspamd integration

This guide explains how to integrate Rspamd with PMG. Rspamd will configured as a custom check, with its spam score appended to the CustomCheck header.

This setup involves 3 steps:

  • Adding Rspamd integration script
  • Configuring PMG to use the custom check
  • Enabling blocking and quarantine filters

Integration script

Create deepofix_rspamd.sh in /usr/local/bin and update following variables with instance details

API_URL="http://localhost:11334/checkv2"
API_PASSWORD="RSPAMD_PASS"

Script download

PMG configuration

Enable custom check in PMG by updating admin section in /etc/pmg/pmg.conf

section: admin
  custom_check 1
  custom_check_path /usr/local/bin/deepofix_spam.sh

Enabling filters

Enable filters for Quarantine and blocking mails in PMG web interface. Following filters will

  • Quarantine when score >= 5
  • Block when score >= 10.

mail filters