Bascule Z-Push, préparation Mail
This commit is contained in:
34
roles/postfix/files/generate_email.sh
Executable file
34
roles/postfix/files/generate_email.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
mailto="$1"
|
||||
comment="$2"
|
||||
|
||||
vowels="aeiouy"
|
||||
consonants="bcdfgjklmnprstvwz"
|
||||
numbers="0123456789"
|
||||
n_vowels=`echo -n $vowels | wc -m`
|
||||
n_consonants=`echo -n $consonants | wc -m`
|
||||
n_numbers=`echo -n $numbers | wc -m`
|
||||
|
||||
syllabes=$((RANDOM % 4 + 2))
|
||||
|
||||
str1=""
|
||||
|
||||
for f in `seq 0 $syllabes`
|
||||
do
|
||||
str1+=${consonants:$((RANDOM % $n_consonants)):1}${vowels:$((RANDOM % $n_vowels)):1}
|
||||
done
|
||||
|
||||
for f in `seq 0 $((syllabes - 1))`
|
||||
do
|
||||
str2+=${numbers:$((RANDOM % $n_numbers)):1}
|
||||
done
|
||||
|
||||
echo "Mail jetable : $str1-$str2@mateu.be"
|
||||
|
||||
echo "$str1-$str2: $mailto ($comment)" >> /etc/aliases
|
||||
/usr/bin/newaliases
|
||||
systemctl reload postfix
|
||||
|
||||
echo -n "" | mail -s "Votre nouvelle adresse temporaire pour $comment" $str1-$str2@mateu.be
|
||||
|
75
roles/postfix/files/main.cf
Normal file
75
roles/postfix/files/main.cf
Normal file
@@ -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
|
||||
|
83
roles/postfix/files/master.cf
Normal file
83
roles/postfix/files/master.cf
Normal file
@@ -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}
|
5
roles/postfix/files/transport
Normal file
5
roles/postfix/files/transport
Normal file
@@ -0,0 +1,5 @@
|
||||
caramail.com smtp:
|
||||
gmx.com smtp:
|
||||
gmx.us smtp:
|
||||
gmx.fr smtp:
|
||||
gmx.net smtp:
|
1
roles/postfix/files/virtual-regexp
Normal file
1
roles/postfix/files/virtual-regexp
Normal file
@@ -0,0 +1 @@
|
||||
/(.*)_(.*)@mateu.be/ ${1}+${2}@mateu.be
|
Reference in New Issue
Block a user