From 66717dcc139a5ac00d7f343f258c4e08bf8bcb36 Mon Sep 17 00:00:00 2001 From: VC Date: Wed, 4 Sep 2019 18:02:51 +0200 Subject: [PATCH] =?UTF-8?q?Bascule=20Z-Push,=20pr=C3=A9paration=20Mail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mail.yml | 7 + production/hosts | 4 +- roles/dovecot/files/dovecot.conf | 86 ++++++++ roles/dovecot/handlers/main.yml | 4 + roles/dovecot/tasks/main.yml | 15 ++ roles/firewall/templates/firewall.j2 | 11 ++ roles/mailman/files/mm_cfg.py | 109 +++++++++++ roles/mailman/handlers/main.yml | 4 + roles/mailman/tasks/main.yml | 11 ++ .../vhosts/autodiscover.libertus.eu.conf.j2 | 0 .../templates/vhosts/z.libertus.eu.conf.j2 | 38 ++++ roles/opendkim/files/dkim/KeyTable | 5 + roles/opendkim/files/dkim/PeerList | 2 + roles/opendkim/files/dkim/SigningTable | 5 + roles/opendkim/files/dkim/TrustedHosts | 1 + roles/opendkim/files/opendkim.conf | 10 + roles/opendkim/handlers/main.yml | 4 + roles/opendkim/tasks/main.yml | 32 +++ roles/postfix/files/generate_email.sh | 34 ++++ roles/postfix/files/main.cf | 75 +++++++ roles/postfix/files/master.cf | 83 ++++++++ roles/postfix/files/transport | 5 + roles/postfix/files/virtual-regexp | 1 + roles/postfix/handlers/main.yml | 14 ++ roles/postfix/tasks/main.yml | 34 ++++ roles/spamassassin/files/local.cf | 184 ++++++++++++++++++ roles/spamassassin/handlers/main.yml | 4 + roles/spamassassin/tasks/main.yml | 15 ++ roles/webapps/tasks/main.yml | 3 + roles/webapps/tasks/z-push.yml | 30 +++ 30 files changed, 828 insertions(+), 2 deletions(-) create mode 100644 mail.yml create mode 100644 roles/dovecot/files/dovecot.conf create mode 100644 roles/dovecot/handlers/main.yml create mode 100644 roles/dovecot/tasks/main.yml create mode 100644 roles/mailman/files/mm_cfg.py create mode 100644 roles/mailman/handlers/main.yml create mode 100644 roles/mailman/tasks/main.yml create mode 100644 roles/nginx/templates/vhosts/autodiscover.libertus.eu.conf.j2 create mode 100644 roles/nginx/templates/vhosts/z.libertus.eu.conf.j2 create mode 100644 roles/opendkim/files/dkim/KeyTable create mode 100644 roles/opendkim/files/dkim/PeerList create mode 100644 roles/opendkim/files/dkim/SigningTable create mode 100644 roles/opendkim/files/dkim/TrustedHosts create mode 100644 roles/opendkim/files/opendkim.conf create mode 100644 roles/opendkim/handlers/main.yml create mode 100644 roles/opendkim/tasks/main.yml create mode 100755 roles/postfix/files/generate_email.sh create mode 100644 roles/postfix/files/main.cf create mode 100644 roles/postfix/files/master.cf create mode 100644 roles/postfix/files/transport create mode 100644 roles/postfix/files/virtual-regexp create mode 100644 roles/postfix/handlers/main.yml create mode 100644 roles/postfix/tasks/main.yml create mode 100644 roles/spamassassin/files/local.cf create mode 100644 roles/spamassassin/handlers/main.yml create mode 100644 roles/spamassassin/tasks/main.yml create mode 100644 roles/webapps/tasks/z-push.yml diff --git a/mail.yml b/mail.yml new file mode 100644 index 0000000..8486cb0 --- /dev/null +++ b/mail.yml @@ -0,0 +1,7 @@ +- hosts: mailservers + roles: + - postfix + - dovecot + - opendkim + - spamassassin + - mailman diff --git a/production/hosts b/production/hosts index 30d99a7..d3fb037 100644 --- a/production/hosts +++ b/production/hosts @@ -22,7 +22,7 @@ baybay-ponay.mateu.be borg_backup_path="['/home', '/etc']" borg_backup_excluded_ bt.dmz.mateu.be borg_backup_path="['/etc', '/var/lib/transmission-daemon']" web1.dmz.mateu.be web2.dmz.mateu.be -mail.dmz.mateu.be +mail.dmz.mateu.be borg_backup_path="['/home', '/etc', '/var/lib/mailman']" jabber.dmz.mateu.be borg_backup_path="['/etc', '/var/lib/prosody']" ror.dmz.mateu.be @@ -41,7 +41,7 @@ edelgard.dmz.mateu.be [webservers] bt.dmz.mateu.be web_hostname="['sonarr.mateu.be','bt.mateu.be','btf.mateu.be']" -web1.dmz.mateu.be web_hostname="['fav.libertus.eu', 'rss.libertus.eu', 'o.libertus.eu', 'blog.libertus.eu', 'mail.libertus.eu', 'perso.nintendojo.fr', 'perso.libertus.eu', 'r.mateu.be','coince.mateu.be']" +web1.dmz.mateu.be web_hostname="['fav.libertus.eu', 'rss.libertus.eu', 'o.libertus.eu', 'blog.libertus.eu', 'mail.libertus.eu', 'perso.nintendojo.fr', 'perso.libertus.eu', 'r.mateu.be','coince.mateu.be', 'z.libertus.eu', 'autodiscover.libertus.eu']" web2.dmz.mateu.be web_hostname="['analyse.nintendojo.fr', 'nintendojo.fr', 'www.nintendojo.fr', 'forum.nintendojo.fr', 'intendo.fr', 'www.intendo.fr']" ror.dmz.mateu.be web_hostname="['m.nintendojo.fr']" #mail.dmz.mateu.be diff --git a/roles/dovecot/files/dovecot.conf b/roles/dovecot/files/dovecot.conf new file mode 100644 index 0000000..77ce0a5 --- /dev/null +++ b/roles/dovecot/files/dovecot.conf @@ -0,0 +1,86 @@ +# 2.2.13: /etc/dovecot/dovecot.conf +# ajout de lmtp (service pour déterminer la socket, protocol pour récupérer les mêmes fonctions que le LDA) +# ajout de auth_username_format = %Ln pour vérifier que l'utilisateur est bien dans la base locale en passant par son nom et non par autre chose… +# 2018-08-20 mortal réintégration du fichier séparé 15-mailbox.conf + nettoyage/réorganisation + réécriture sieve globale +# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.0 + +listen = *,[::] + +protocols = imap lmtp + +ssl_cert = > /etc/aliases +/usr/bin/newaliases +systemctl reload postfix + +echo -n "" | mail -s "Votre nouvelle adresse temporaire pour $comment" $str1-$str2@mateu.be + diff --git a/roles/postfix/files/main.cf b/roles/postfix/files/main.cf new file mode 100644 index 0000000..aa2b57f --- /dev/null +++ b/roles/postfix/files/main.cf @@ -0,0 +1,75 @@ +## Configuration de postfix +## 05/08/2018 mortal Suppression de mailbox_command au profit de mailbox_transport : c'est toujours dovecot qui fait la livraison mais à travers une socket plutôt qu'un programme lancé par postfix +## 30/07/2015 mortal Suppression de la politique de réception pour wordpress@nintendojofr.com +## 18/04/2013 mortal Changement de la bannière +## 14/11/2012 mortal Ajout des domaines en relais ecolejmoulin-lepecq.fr +## 10/07/2012 mortal Ajout des instructions smtp en plus des instructions smtpd (avec smtp_tls_CApath pour avoir toutes les autorités de certif du système) +## 13/06/2012 mortal Ajout du milter pour DKIM +## 08/01/2012 mortal Ajout de recipient_delimiter pour mettre automatique des adresses en wildcard +## 06/12/2011 mortal Ajout de la politique SPF et de la timelimit pour les politiques +## 17/09/2010 mortal Suppression de la gestion de dalleau.fr +## 24/11/2008 mortal Ajout de la configuration home_mailbox +## 23/11/2009 mortal Ajout des options pour pop-before-smtp + ajout des options pour être serveur et client SMTP sur TLS +## 28/11/2009 mortal Ajout du domaine libertus.eu +## 02/12/2009 mortal Ajout du support IPv6 +## 09/12/2009 mortal Ajout de dalleau.fr +## 27/05/2010 mortal Suppression du passage par procmail +## 28/05/2010 mortal Authentification SASL auprès de dovecot, obligation d'être en TLS pour s'authentifier + +mail_name = I iz a mail server +inet_protocols = all +inet_interfaces = all +mynetworks = 163.172.112.17, 127.0.0.1, [::1]/128, 10.233.212.64/27, [2001:bc8:26c1:101::]/64, 10.233.212.0/26, [2001:bc8:26c1:105::]/64, 172.17.0.0/16 +#relayhost = 178.32.223.202 +relayhost = 37.187.5.75 +transport_maps = hash:/etc/postfix/transport +myhostname = n0box2.mateu.be +myorigin = mateu.be +mydestination = $myhostname,localhost.$mydomain,localhost,mateu.be,libertus.eu,p.libertus.eu,pipoworld.fr,nintendojo.fr +recipient_delimiter = + +virtual_alias_maps = regexp:/etc/postfix/virtual-regexp + +mail_owner = postfix +unknown_local_recipient_reject_code = 550 +alias_maps = hash:/etc/aliases +alias_database = hash:/etc/aliases +#mailbox_command = /usr/lib/dovecot/deliver +mailbox_transport = lmtp:inet:127.0.0.1:24 +message_size_limit = 26214400 + +#SMTP de secours +maximal_queue_lifetime = 5d + +## Référence de chiffrement TLS +# serveur SMTP +smtpd_tls_cert_file = /etc/x509/smtp.libertus.eu/fullchain.cer +smtpd_tls_key_file = /etc/x509/smtp.libertus.eu/smtp.libertus.eu.key +smtpd_use_tls = yes +smtpd_tls_protocols = !SSLv2,!SSLv3 +smtpd_tls_auth_only = yes +smtpd_tls_session_cache_timeout = 10s +smtpd_tls_loglevel = 1 +# client SMTP +smtp_tls_CApath = /etc/ssl/certs +smtp_tls_cert_file = /etc/x509/smtp.libertus.eu/fullchain.cer +smtp_tls_key_file = /etc/x509/smtp.libertus.eu/smtp.libertus.eu.key +smtp_use_tls = yes +smtp_tls_protocols = !SSLv2,!SSLv3 +smtp_tls_security_level = may +smtp_tls_loglevel = 1 + +# Référence de SASL (se sert de la socket de dovecot) +smtpd_sasl_auth_enable = yes +broken_sasl_auth_clients = yes +smtpd_sasl_security_options = noanonymous +smtpd_sasl_type = dovecot +smtpd_sasl_path = inet:localhost:26 + +# DKIM +milter_default_action = accept +milter_protocol = 2 +smtpd_milters = inet:localhost:8891 +non_smtpd_milters = inet:localhost:8891 + +compatibility_level = 2 + diff --git a/roles/postfix/files/master.cf b/roles/postfix/files/master.cf new file mode 100644 index 0000000..b1416f9 --- /dev/null +++ b/roles/postfix/files/master.cf @@ -0,0 +1,83 @@ +# +# Postfix master process configuration file. For details on the format +# of the file, see the master(5) manual page (command: "man 5 master"). +# +# Do not forget to execute "postfix reload" after editing this file. +# +# ========================================================================== +# service type private unpriv chroot wakeup maxproc command + args +# (yes) (yes) (yes) (never) (100) +# ========================================================================== +smtp inet n - - - - smtpd -o content_filter=spamassassin +submission inet n - - - - smtpd + -o smtpd_tls_security_level=encrypt + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject +# -o milter_macro_daemon_name=ORIGINATING +smtps inet n - - - - smtpd + -o smtpd_tls_wrappermode=yes + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject +# -o milter_macro_daemon_name=ORIGINATING +#628 inet n - - - - qmqpd +pickup fifo n - - 60 1 pickup +cleanup unix n - - - 0 cleanup +qmgr fifo n - n 300 1 qmgr +#qmgr fifo n - - 300 1 oqmgr +tlsmgr unix - - - 1000? 1 tlsmgr +rewrite unix - - - - - trivial-rewrite +bounce unix - - - - 0 bounce +defer unix - - - - 0 bounce +trace unix - - - - 0 bounce +verify unix - - - - 1 verify +flush unix n - - 1000? 0 flush +proxymap unix - - n - - proxymap +proxywrite unix - - n - 1 proxymap +smtp unix - - - - - smtp +# When relaying mail as backup MX, disable fallback_relay to avoid MX loops +relay unix - - - - - smtp + -o smtp_fallback_relay= +# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 +showq unix n - - - - showq +error unix - - - - - error +retry unix - - - - - error +discard unix - - - - - discard +local unix - n n - - local +virtual unix - n n - - virtual +lmtp unix - - - - - lmtp +anvil unix - - - - 1 anvil +scache unix - - - - 1 scache +# +# ==================================================================== +# Interfaces to non-Postfix software. Be sure to examine the manual +# pages of the non-Postfix software to find out what options it wants. +# +# Many of the following services use the Postfix pipe(8) delivery +# agent. See the pipe(8) man page for information about ${recipient} +# and other message envelope options. +# ==================================================================== +# +# maildrop. See the Postfix MAILDROP_README file for details. +# Also specify in main.cf: maildrop_destination_recipient_limit=1 +# +maildrop unix - n n - - pipe + flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} +# +# See the Postfix UUCP_README file for configuration details. +# +uucp unix - n n - - pipe + flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) +# +# Other external delivery methods. +# +ifmail unix - n n - - pipe + flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) +bsmtp unix - n n - - pipe + flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient +scalemail-backend unix - n n - 2 pipe + flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} +mailman unix - n n - - pipe + flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py + ${nexthop} ${user} +spamassassin unix - n n - - pipe + flags=R user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} diff --git a/roles/postfix/files/transport b/roles/postfix/files/transport new file mode 100644 index 0000000..199cb9c --- /dev/null +++ b/roles/postfix/files/transport @@ -0,0 +1,5 @@ +caramail.com smtp: +gmx.com smtp: +gmx.us smtp: +gmx.fr smtp: +gmx.net smtp: diff --git a/roles/postfix/files/virtual-regexp b/roles/postfix/files/virtual-regexp new file mode 100644 index 0000000..f8f9b4b --- /dev/null +++ b/roles/postfix/files/virtual-regexp @@ -0,0 +1 @@ +/(.*)_(.*)@mateu.be/ ${1}+${2}@mateu.be diff --git a/roles/postfix/handlers/main.yml b/roles/postfix/handlers/main.yml new file mode 100644 index 0000000..7ec66b0 --- /dev/null +++ b/roles/postfix/handlers/main.yml @@ -0,0 +1,14 @@ +- name: postmap virtual-regexp + command: postmap /etc/postfix/virtual-regexp + listen: "postmap files" + +- name: postmap transport + command: postmap /etc/postfix/transport + listen: "postmap files" + +- name: restart postfix + service: + name: postfix + state: restarted + + diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml new file mode 100644 index 0000000..98edee7 --- /dev/null +++ b/roles/postfix/tasks/main.yml @@ -0,0 +1,34 @@ +- name: install postfix + package: + name: postfix + state: present + +- name: main configuration files + copy: + src: "./files/{{ item }}" + dest: "/etc/postfix/{{ item }}" + loop: + - main.cf + - master.cf + notify: + - restart postfix + +- name: map files + copy: + src: "./files/{{ item }}" + dest: "/etc/postfix/{{ item }}" + loop: + - transport + - virtual-regexp + notify: + - postmap files + - restart postfix + +- name: mail generation script + copy: + src: ./files/generate_email.sh + dest: /usr/local/bin/generate_email.sh + owner: root + group: root + mode: '0755' + diff --git a/roles/spamassassin/files/local.cf b/roles/spamassassin/files/local.cf new file mode 100644 index 0000000..d93a66c --- /dev/null +++ b/roles/spamassassin/files/local.cf @@ -0,0 +1,184 @@ +required_hits 3.5 +report_safe 1 +rewrite_header Subject *****SPAM***** +use_bayes 1 +bayes_auto_learn 1 +ok_locales fr +score UNWANTED_LANGUAGE_BODY 5 + +rawbody LOCAL_AGRAND_PENIS /AGRANDISSEMENT DU P/i +score LOCAL_AGRAND_PENIS 50.0 + +rawbody LOCAL_NO_CASINO /casino review/i +score LOCAL_NO_CASINO 5.0 + +header LOCAL_PROFIT Subject =~ /profit opportunity/i +score LOCAL_PROFIT 10.0 + +header LOCAL_PHARMACY From =~ /pharmacy/i +score LOCAL_PHARMACY 3.0 + +header LOCAL_PHARMARCIE From =~ /premium pharmacie/i +score LOCAL_PHARMACIE 3.0 + +header LOCAL_VIAGRA From =~ /viagra/i +score LOCAL_VIAGRA 10.0 + +header LOCAL_POTENCY From =~ /potency/i +score LOCAL_POTENCY 3.0 + +header LOCAL_POTENCE From =~ /potence/i +score LOCAL_POTENCE 3.0 + +header LOCAL_NEUFIMMO To =~ /neufimmo\.fr/i +score LOCAL_NEUFIMMO 50.0 + +header LOCAL_TESTO Subject =~ /testostérone/i +score LOCAL_TESTO 3.0 + +header LOCAL_RENCO Subject =~ /pour le sexe/i +score LOCAL_RENCO 10.0 + +header LOCAL_PROSTATITE Subject =~ /prostatite/i +score LOCAL_PROSTATITE 10.0 + +header LOCAL_PILLS Subject =~ /pills for/i +score LOCAL_PILLS 10.0 + +header LOCAL_PUISS Subject =~ /puissance sex/i +score LOCAL_PUISS 10.0 + +header LOCAL_PILU Subject =~ /pilules de puissance/i +score LOCAL_PILU 10.0 + +header LOCAL_PPUISS Subject =~ /pour la puissance/i +score LOCAL_PPUISS 10.0 + +header LOCAL_EXCIT Subject =~ /excitateur/i +score LOCAL_EXCIT 10.0 + +header LOCAL_CAVIAR Subject =~ /beluga caviar/i +score LOCAL_CAVIAR 10.0 + +header LOCAL_BITCOIN Subject =~ /bitcoin/i +score LOCAL_BITCOIN 10.0 + +# Whitelist manuel +whitelist_from *@chichiclothing.com + +# Blacklist manuel +blacklist_from *@bizertym.de +blacklist_from *@*.city +blacklist_from *@arjenam.de +blacklist_from *@bizers.eu +blacklist_from *@brandaspiration.com +blacklist_from *@bitermalens.de +blacklist_from *@jortemsa.eu +blacklist_from *@yotares.eu +blacklist_from *@aerogan.eu +blacklist_from *@jimser.eu +blacklist_from *@rostovsh.eu +blacklist_from *@allbizem.eu +blacklist_from *@onlinepms.eu +blacklist_from *@bookisem.eu +blacklist_from *@timenfor.eu +blacklist_from *@fooders.eu +blacklist_from *@versalem.eu +blacklist_from *@hoomeltd.eu +blacklist_from *@businnes.eu +blacklist_from *@bambool.eu +blacklist_from *@alexoni.eu +blacklist_from *@*.network +blacklist_from *@macketom.eu +blacklist_from *@bestorbit.eu +blacklist_from *@stopglisse.com +blacklist_from *@wintemo.eu +blacklist_from *@bintego.eu +blacklist_from *@mercyr.eu +blacklist_from *@bestione.eu +blacklist_from *@wolemse.eu +blacklist_from *@dopilsa.eu +blacklist_from *@monetry.eu +blacklist_from *@@ragaasacademy.com +blacklist_from *@childprotectionnetwork.org +blacklist_from *@starvillage.net +blacklist_from *@aberton.eu +blacklist_from *@boomange.eu +blacklist_from *@gormia.eu +blacklist_from *@amteros.eu +blacklist_from *@fulince.eu +blacklist_from *@nemaner.eu +blacklist_from *@tankofworlds.eu +blacklist_from *@noybery.institute +blacklist_from *@matrixe.wtf +blacklist_from *@chatnrun.nl +blacklist_from *@livestorem.eu +blacklist_from *@jokmexi.eu +blacklist_from *@noomberg.eu +blacklist_from *@forestmen.eu +blacklist_from *@medicome.eu +blacklist_from *@orgsoft.eu +blacklist_from *@dreamse.eu +blacklist_from *@lisamo.eu +blacklist_from *@abinjorna.eu +blacklist_from *@dreamse.eu +blacklist_from *@jominsta.eu +blacklist_from *@minfine.eu +blacklist_from *@mainstree.eu +blacklist_from *@financerm.eu +blacklist_from *@dinamer.eu +blacklist_from *@boominge.eu +blacklist_from *@centroban.eu +blacklist_from *@hismag.eu +blacklist_from *@dinercam.eu +blacklist_from *@*.art +blacklist_from *@onymaxys.eu +blacklist_from *@tramstreem.eu +blacklist_from *@gylinsa.eu +blacklist_from *@shallems.eu +blacklist_from *@oxizone.eu +blacklist_from account@liberynws.com +blacklist_from *@pivotalperspectives.org +blacklist_from account@zepeem.com +blacklist_from *@*clubexpresso.com +blacklist_from *@metta.hk +blacklist_from voicemail@libertus.eu +blacklist_from *@*bousey.com +blacklist_from *@shopermes.com +blacklist_from *@*.thampsen.com +blacklist_from *@octavainc.com +blacklist_from nathalie-bretel@orange.fr +blacklist_from bare.vanessa@orange.fr +blacklist_from *@sport-fitness-advisor.com +blacklist_from *@*.ua +blacklist_from *@*.co.ua +blacklist_from *@*.biz.ua +blacklist_from *@marineland.fr +blacklist_from *@*.calvacom.fr +blacklist_from *@addel.org +blacklist_from *@arbatov.eu +blacklist_from *@solyf.fr +blacklist_from *@jkyg.espmp-cufr.net +blacklist_from *@mnptwdo.com +blacklist_from *@audecibel.online +blacklist_from *@goletsetcom.online +blacklist_from contact@wordpressformation.fr +blacklist_from *@wistorym.eu +blacklist_from *@viream.eu +blacklist_from *@frederikem.eu +blacklist_from *@lincoral.eu +blacklist_from *@bassai.eu +blacklist_from *@jokiser.eu +blacklist_from *@loomberge.eu +blacklist_from *@eurosalm.eu +blacklist_from *@motherm.eu +blacklist_from *@newlevis.eu +blacklist_from *@flixbus.com +blacklist_from *@flixbus.fr +blacklist_from *@woolsic.eu +blacklist_from *@max-exposure.com +blacklist_from *@tophostel.eu +blacklist_from *@jodas.fr +blacklist_from *@rentautos.eu +blacklist_from *@yahting.eu +blacklist_from *@newsyork.eu diff --git a/roles/spamassassin/handlers/main.yml b/roles/spamassassin/handlers/main.yml new file mode 100644 index 0000000..5dde9e2 --- /dev/null +++ b/roles/spamassassin/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart spamassassin + service: + name: spamassassin + state: restarted diff --git a/roles/spamassassin/tasks/main.yml b/roles/spamassassin/tasks/main.yml new file mode 100644 index 0000000..578ca40 --- /dev/null +++ b/roles/spamassassin/tasks/main.yml @@ -0,0 +1,15 @@ +- name: install spamassassin + package: + name: "{{ item }}" + state: present + loop: + - spamassassin + - libmail-dkim-perl + - libmail-spf-perl + +- name: main configuration files + copy: + src: ./files/local.cf + dest: /etc/spamassassin/local.cf + notify: + - restart spamassassin diff --git a/roles/webapps/tasks/main.yml b/roles/webapps/tasks/main.yml index 36a39c1..bc975f9 100644 --- a/roles/webapps/tasks/main.yml +++ b/roles/webapps/tasks/main.yml @@ -4,6 +4,9 @@ - name: include php flag for NextCloud include_tasks: nextcloud.yml when: inventory_hostname == 'web1.dmz.mateu.be' +- name: include z-push + include_tasks: z-push.yml + when: inventory_hostname == 'web1.dmz.mateu.be' - name: include matomo for web2 include_tasks: matomo.yml when: inventory_hostname == 'web2.dmz.mateu.be' diff --git a/roles/webapps/tasks/z-push.yml b/roles/webapps/tasks/z-push.yml new file mode 100644 index 0000000..21c5abe --- /dev/null +++ b/roles/webapps/tasks/z-push.yml @@ -0,0 +1,30 @@ +- name: install z-push repokey + apt_key: + url: http://repo.z-hub.io/z-push:/final/Debian_10/Release.key + state: present + +- name: install z-push repo + apt_repository: + repo: deb http://repo.z-hub.io/z-push:/final/Debian_10/ / + state: present + +- name: install z-push packages + package: + name: "{{ item }}" + state: present + loop: + - z-push-autodiscover + - z-push-backend-caldav + - z-push-backend-carddav + - z-push-backend-combined + - z-push-backend-imap + - z-push-common + - z-push-ipc-sharedmemory + - z-push-state-sql + +- name: log directory + file: + path: /var/log/z-push/ + owner: www-data + group: www-data + state: directory