Skip to content
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

Dovecot: Fix antispam integration #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions templates/dovecot/conf.d/15-mailboxes.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,28 @@
namespace inbox {
# These mailboxes are widely used and could perhaps be created automatically:
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
{% if ansible_local['mailserver_have_antispam'] %}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
{% endif %}
mailbox Trash {
auto = subscribe
special_use = \Trash
}

# For \Sent mailboxes there are two widely used names. We'll mark both of
# them as \Sent. User typically deletes one of them if duplicates are created.
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox "Sent Messages" {
auto = subscribe
special_use = \Sent
}

Expand Down
75 changes: 0 additions & 75 deletions templates/dovecot/conf.d/90-sieve-extprograms.conf.j2

This file was deleted.

4 changes: 2 additions & 2 deletions templates/dovecot/sieve/report-ham.sieve.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
########### Managed by ansible (role: mailserver), do not edit! ############
############################################################################

require ["copy"];
require ["variables", "copy", "environment"];

if environment :matches "imap.mailbox" "*" {
set "mailbox" "${1}";
Expand All @@ -12,4 +12,4 @@ if string "${mailbox}" "Trash" {
stop;
}

redirect :copy "__spamuser_spam@{{ mailserver_domain }}";
redirect :copy "__spamuser_ham@{{ mailserver_domain }}";
4 changes: 2 additions & 2 deletions templates/dovecot/users.j2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__spamuser_spam:{plain}password:::::
__spamuser_ham:{plain}password:::::
__spamuser_spam:{plain}password:vmail:vmail::/var/mail/boxes/__spamuser_spam:/usr/sbin/nologin:userdb_mail=mbox:/var/mail/boxes/__spamuser_spam
__spamuser_ham:{plain}password:vmail:vmail::/var/mail/boxes/__spamuser_spam:/usr/sbin/nologin:userdb_mail=mbox:/var/mail/boxes/__spamuser_ham
2 changes: 2 additions & 0 deletions templates/postfix/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,11 @@ non_smtpd_milters = inet:127.0.0.1:42420
{% endif %}

{% if ansible_local['mailserver_have_antispam']|default(False) %}
{% if antispam_amavis|default(False) %}
# Pass incoming messages through amavis for virus checks
# Spamassassin is done elsewhere
content_filter = amavisfeed:[127.0.0.1]:10024
{% endif %}
# Remove repeated Received headers from amavis
header_checks = pcre:/etc/postfix/cleanup-headers
{% endif %}
Expand Down