Commit 8919302b authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Merge branch 'rspamd' into 'master'

Replace SpamAssassin with Rspamd

See merge request !42
parents f853a292 bcf1c981
Pipeline #2957 passed with stage
in 29 seconds
......@@ -27,7 +27,7 @@
- { role: borg_client, tags: ["borg"] }
- { role: certbot }
- { role: nginx }
- { role: spampd, tags: ["mail"] }
- { role: rspamd, tags: ["mail"] }
- { role: unbound, tags: ["mail"] }
- { role: postfix, postfix_relayhost: "mail.archlinux.org", postfix_smtpd_public: true, postfix_patchwork_enabled: true, tags: ["mail"] }
- { role: opendkim, dkim_selector: apollo, tags: ['mail'] }
......
......@@ -26,7 +26,7 @@
- firewall
roles:
- nginx
- spampd
- rspamd
- { role: mariadb, mariadb_query_cache_type: '0', mariadb_innodb_file_per_table: True }
# luna is hosting mailman lists; this postfix role does not cater to this yet
# TODO: make postfix role handle mailman config?
......
......@@ -10,7 +10,7 @@
- { role: certbot }
- { role: postfix, postfix_server: true, postfix_smtpd_public: true, tags: ['mail'] }
- { role: dovecot }
- { role: spampd, tags: ["mail"] }
- { role: rspamd, tags: ["mail"] }
- { role: unbound, tags: ["mail"] }
- { role: postfwd, tags: ['mail'] }
- { role: archusers }
......
......@@ -11,7 +11,7 @@
- { role: borg_client, tags: ['borg'] }
- { role: opendkim, dkim_selector: orion, tags: ['mail'] }
- { role: dovecot }
- { role: spampd, tags: ["mail"] }
- { role: rspamd, tags: ["mail"] }
- { role: unbound, tags: ["mail"] }
- { role: postfwd, tags: ['mail'] }
- { role: postfix, postfix_server: true, postfix_smtpd_public: true, tags: ['mail'] }
......
require ["mailbox", "fileinto"];
if header "X-Spam" "Yes"{
fileinto :create "Junk";
stop;
}
......@@ -3,3 +3,7 @@
- name: reload dovecot
service: name=dovecot state=restarted
- name: run sievec
command: /usr/bin/sievec /etc/dovecot/sieve/{{ item }}
loop:
- spam-to-folder.sieve
......@@ -18,6 +18,14 @@
- name: install PAM config
copy: src=pam.d.dovecot dest=/etc/pam.d/dovecot mode=0644 owner=root group=root
- name: create dovecot sieve dir
file: path=/etc/dovecot/sieve state=directory owner=root group=root mode=0755
- name: install spam-to-folder.sieve
copy: src=spam-to-folder.sieve dest=/etc/dovecot/sieve/ mode=0644 owner=root group=root
notify:
- run sievec
- name: install dovecot cert renewal hook
template: src=letsencrypt.hook.d.j2 dest=/etc/letsencrypt/hook.d/dovecot owner=root group=root mode=0755
......
......@@ -44,6 +44,7 @@ plugin {
sieve_dir = ~/.sieve
sieve_global_dir = /etc/dovecot/sieve/global/
sieve_global_path = /etc/dovecot/sieve/default.sieve
sieve_before = /etc/dovecot/sieve/spam-to-folder.sieve
mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
mail_log_fields = uid box msgid size
......
/X-Spam-Status: Yes,/ REJECT Your message has been rejected by Spamassassin
......@@ -165,8 +165,8 @@ submission_recipient_restrictions=
permit_sasl_authenticated,
reject
smtpd_milters=unix:/var/spool/opendkim/opendkim
non_smtpd_milters=unix:/var/spool/opendkim/opendkim
smtpd_milters=unix:/var/spool/opendkim/opendkim inet:localhost:11332
non_smtpd_milters=unix:/var/spool/opendkim/opendkim inet:localhost:11332
# Pass internal mails through filters so they get signed by opendkim
# XXX: Be careful not to have filters that may reject mails!
......
......@@ -14,7 +14,6 @@
# ==========================================================================
{% if postfix_smtpd_public %}
smtp inet n - n - - smtpd
-o smtpd_proxy_filter=[127.0.0.1]:10025
-o smtpd_client_connection_count_limit=20
-o smtpd_proxy_options=speed_adjust
{% else %}
......@@ -30,7 +29,6 @@ submission inet n - n - - smtpd
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=$submission_recipient_restrictions
-o content_filter=smtp:[127.0.0.1]:10025
-o smtpd_client_connection_count_limit=10
#-o smtpd_milters=unix:/var/spool/opendkim/opendkim
{% endif %}
......
---
- name: install redis
pacman: name=redis state=present
- name: start and enable redis
service: name=redis enabled=yes state=started
systemd = true;
type = "console";
extended_spam_headers = true;
use = ["authentication-results"];
authenticated_headers = ["authentication-results"];
write_servers = "127.0.0.1";
read_servers = "127.0.0.1";
---
- name: reload rspamd
service: name=rspamd state=reloaded
---
dependencies:
- role: redis
---
- name: install rspamd
pacman: name=rspamd state=present
- name: install config
copy: src=local.d/ dest=/etc/rspamd/local.d/ owner=root group=root mode=0644
notify:
- reload rspamd
- name: start and enable rspamd
service: name=rspamd enabled=yes state=started
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = spamassassin
[Action]
When = PostTransaction
Exec = /usr/bin/systemctl start sa-update.service
[Unit]
Description=sa-update
[Service]
Type=oneshot
ExecStart=/usr/local/bin/sa-update.sh
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment