From 9bc98d11f6901b636f5fe115521752cf325096c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ROUSSEAU=20Cl=C3=A9ment?= Date: Sun, 9 Dec 2018 17:27:13 +0100 Subject: [PATCH] Sauvegarde --- Linux/Messagerie/mail.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Linux/Messagerie/mail.sh b/Linux/Messagerie/mail.sh index dea7940..5e22489 100644 --- a/Linux/Messagerie/mail.sh +++ b/Linux/Messagerie/mail.sh @@ -62,6 +62,8 @@ then echo "-- Installation du plugin postfix-mysql terminé !" apt-get install dovecot-core dovecot-imapd dovecot-lmtpd dovecot-mysql -y echo "-- Installation de Dovecot terminé !" + apt-get install spamassassin spamc -y + echo "-- Installation de SpamAssassin terminé !" apt-get install apache2 -y echo "-- Installation de Apache terminé !" apt-get install php php-mysql php-imap -y @@ -166,8 +168,13 @@ then echo -e "service imap-login {\n\tinet_listener imap {\n\t\tport = 143\n\t}\n\tinet_listener imaps {\n\t\tport = 993\n\t\tssl = yes\n\t}\n\tservice_count = 0\n}\nservice lmtp {\n\tunix_listener /var/spool/postfix/private/dovecot-lmtp {\n\t\tmode = 0600\n\t\tuser = postfix\n\t\tgroup = postfix\n\t}\n}\nservice auth {\n\tunix_listener auth-userdb {\n\t\tmode = 0600\n\t\tuser = vmail\n\t\tgroup = vmail\n\t}\n\tunix_listener /var/spool/postfix/private/auth {\n\t\tmode = 0666\n\t\tuser = postfix\n\t\tgroup = postfix\n\t}\n\tuser = dovecot\n}\nservice auth-worker {\n\tuser = vmail\n}" >> /etc/dovecot/conf.d/10-master.conf echo "" > /etc/dovecot/conf.d/10-ssl.conf echo -e "ssl = required\nssl_cert = > /etc/dovecot/conf.d/10-ssl.conf - - + echo "#################################" + echo "# Configuration de SpamAssassin #" + echo "#################################" + echo "" > /etc/spamassassin/local.cf + echo -e "rewrite_header Subject *****SPAM*****\n\nifplugin Mail::SpamAssassin::Plugin::Shortcircuit\n\nendif # Mail::SpamAssassin::Plugin::Shortcircuit\n\nreport_safe 0\nwhitelist_auth *@$DOMAIN\n\nadd_header all Report _REPORT_\nadd_header spam Flag _YESNOCAPS_\nadd_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_\nadd_header all Level _STARS(*)_\nadd_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_" >> /etc/spamassassin/local.cf + echo "" > /etc/default/spamassassin + echo -e "ENABLED=0\nOPTIONS=\"--create-prefs --max-children 5 --helper-home-dir\"\nPIDFILE=\"/var/run/spamd.pid\"\nCRON=0\n" >> /etc/default/spamassassin echo "#############################" @@ -217,10 +224,18 @@ echo "# Redémarrage des services #" echo "############################" if [ $MAIL == 'O' ]; then + systemctl enable postfix.service + echo "-- Postfix activé !" service postfix restart echo "-- Postfix redémarré !" + systemctl enable dovecot.service + echo "-- Dovecot activé !" service dovecot restart - echo "-- dovecot redémarré !" + echo "-- Dovecot redémarré !" + systemctl enable spamassassin.service + echo "-- SpamAssassin activé !" + service spamassassin restart + echo "-- SpamAssassin redémarré !" fi cd $SOURCE