Skip to content

Instantly share code, notes, and snippets.

@dmckeone
Last active January 26, 2026 21:36
Show Gist options
  • Select an option

  • Save dmckeone/f88619ef61677267057fa5bcc6caf5cb to your computer and use it in GitHub Desktop.

Select an option

Save dmckeone/f88619ef61677267057fa5bcc6caf5cb to your computer and use it in GitHub Desktop.
Dovecot 2.4 sieve for sending rspamd Spam education to a relay/gateway
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
# See dovecot.conf for matching configuration: https://gist.github.com/dmckeone/7cdf170624d77c4ddcdce1721c6f760e
# This configuration is intended to be used with Jinja2, so all variables look like: {{ variable }}
# NOTE: When moving from Trash to Junk assume that the user is intentionally flagging an email as Junk
if environment :matches "imap.user" "*" {
set "username" "${1}";
}
pipe :copy "rspamc" ["-h", "{{ mail_relay }}", "-P", "{{ rspamd_password }}", "-d", "${username}", "learn_spam"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment