Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
linux:postfix [12-07-2013 15:51] edmc73 |
linux:postfix [18-02-2017 00:12] edmc73 [DKIM] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Postfix ====== | ====== Postfix ====== | ||
- | http:// | + | * http:// |
+ | * http:// | ||
+ | * http:// | ||
- | http://www.system-linux.eu/index.php? | + | Un super site en français => http://x.guimard.free.fr/postfix/ |
+ | ===== Configuration ===== | ||
+ | Au départ voici les fichiers que vous avez | ||
+ | :/ | ||
+ | dynamicmaps.cf | ||
+ | |||
+ | Au final vous aurez | ||
+ | :/ | ||
+ | dynamicmaps.cf | ||
+ | |||
+ | ==== dynamicmaps.cf ==== | ||
+ | :!: Je ne l' | ||
+ | |||
+ | ==== generic et generic.db ==== | ||
+ | Permet de renommer l' | ||
+ | root@edmc73.com | ||
+ | www-data@edmc73.com webmaster@edmc73.com | ||
+ | |||
+ | Les mails envoyés par l' | ||
+ | |||
+ | Ajouter dans le fichier de conf **/ | ||
+ | smtp_generic_maps = hash:/ | ||
+ | |||
+ | Exemple de fichier **/ | ||
+ | his@localdomain.local | ||
+ | her@localdomain.local | ||
+ | @localdomain.local | ||
+ | |||
+ | Ne pas oublier d' | ||
+ | postmap / | ||
+ | | ||
+ | Et de recharger la config de postfix | ||
+ | service postfix reload | ||
+ | |||
+ | ==== main.cf ==== | ||
+ | **main.cf** est le fichier de configuration principal. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== master.cf ==== | ||
+ | |||
+ | Rien à faire de spécial | ||
+ | |||
+ | ==== postfix-files, | ||
+ | |||
+ | Ne pas toucher | ||
+ | |||
+ | ==== sasl ==== | ||
+ | |||
+ | Sert à sécuriser le SMTP. Assez compliqué, plus d'info => http:// | ||
+ | |||
+ | ==== transport et transport.db ==== | ||
+ | Typiquement, | ||
+ | |||
+ | Dans le cas des mails envoyés vers orange et wanadoo, il faut ralentir le trafic sous peine d' | ||
+ | wanadoo.com slow: | ||
+ | wanadoo.fr slow: | ||
+ | orange.com slow: | ||
+ | orange.fr slow: | ||
+ | |||
+ | suivi de la commande | ||
+ | postmap transport | ||
+ | |||
+ | On rajoutera à la fin du fichier **master.cf** | ||
+ | # | ||
+ | # service type private unpriv chroot wakeup maxproc command + args | ||
+ | # (yes) (yes) (yes) (never) (100) | ||
+ | # | ||
+ | slow unix - - n - 5 smtp -o syslog_name=postfix-slow -o smtp_destination_concurrency_limit=3 -o slow_destination_rate_delay=1 | ||
+ | |||
+ | Puis ceci dans le fichier **main.cf** | ||
+ | transport_maps = hash:/ | ||
+ | slow_destination_recipient_limit = 20 | ||
+ | slow_destination_concurrency_limit = 2 | ||
+ | |||
+ | On relis la config | ||
+ | service postfix reload | ||
+ | |||
+ | ==== mailname ==== | ||
+ | |||
+ | Le fichier **/ | ||
+ | myorigin = / | ||
===== Commandes ===== | ===== Commandes ===== | ||
Ligne 62: | Ligne 146: | ||
http:// | http:// | ||
+ | |||
+ | DÉTAILS DE LA SOLUTION : TRANSPORT SPÉCIFIQUE POUR ORANGE/ | ||
+ | |||
+ | vi / | ||
+ | |||
+ | wanadoo.com slow: | ||
+ | wanadoo.fr slow: | ||
+ | orange.com slow: | ||
+ | orange.fr slow: | ||
+ | |||
+ | puis | ||
+ | postmap / | ||
+ | |||
+ | vi / | ||
+ | |||
+ | < | ||
+ | # service type private unpriv chroot wakeup maxproc command + args | ||
+ | # (yes) (yes) (yes) (never) (100) | ||
+ | # | ||
+ | slow unix - - n - 5 smtp -o syslog_name=postfix-slow -o smtp_destination_concurrency_limit=3 -o slow_destination_rate_delay=1</ | ||
+ | |||
+ | vi / | ||
+ | | ||
+ | < | ||
+ | slow_destination_recipient_limit = 20 | ||
+ | slow_destination_concurrency_limit = 2</ | ||
+ | |||
+ | et finalement : | ||
+ | / | ||
+ | |||
+ | Les mails se stockent tout de même en queue, mais la file se vide ensuite relativement rapidement | ||
+ | |||
+ | ===== Statistiques ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | Ce lien explique comment superviser postfix avec zabbix mais on peut découvrir aussi le script **pflogsumm.pl** qui permet de ressortir des stats. | ||
+ | |||
+ | ===== DKIM ===== | ||
+ | |||
+ | Ajouter une signature DKIM à vos emails sortant => http:// | ||
+ | |||
+ | Un autre tuto très bien détaillé => http:// | ||
+ | |||
+ | |||
+ | ===== SSL / TLS ===== | ||
+ | |||
+ | Ajouter un certificat SSL valide et configurer le TLS. | ||
+ | |||
+ | Utilisons [[linux: | ||
+ | |||
+ | Créez en 1er une config apache qui permet d' | ||
+ | |||
+ | ./cert-auto certonly --rsa-key-size 4096 -d mail.domain.tld --email admin@domain.tld | ||
+ | |||
+ | Bon, je l' | ||
+ | < | ||
+ | Saving debug log to / | ||
+ | Cert not yet due for renewal | ||
+ | |||
+ | You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry. | ||
+ | (ref: / | ||
+ | |||
+ | What would you like to do? | ||
+ | ------------------------------------------------------------------------------- | ||
+ | 1: Attempt to reinstall this existing certificate | ||
+ | 2: Renew & replace the cert (limit ~5 per 7 days) | ||
+ | ------------------------------------------------------------------------------- | ||
+ | Select the appropriate number [1-2] then [enter] (press ' | ||
+ | Keeping the existing certificate | ||
+ | Created an SSL vhost at / | ||
+ | Deploying Certificate to VirtualHost / | ||
+ | Enabling available site: / | ||
+ | |||
+ | Please choose whether HTTPS access is required or optional. | ||
+ | ------------------------------------------------------------------------------- | ||
+ | 1: Easy - Allow both HTTP and HTTPS access to these sites | ||
+ | 2: Secure - Make all requests redirect to secure HTTPS access | ||
+ | ------------------------------------------------------------------------------- | ||
+ | Select the appropriate number [1-2] then [enter] (press ' | ||
+ | Redirecting vhost in / | ||
+ | |||
+ | ------------------------------------------------------------------------------- | ||
+ | Congratulations! You have successfully enabled https:// | ||
+ | |||
+ | You should test your configuration at: | ||
+ | https:// | ||
+ | ------------------------------------------------------------------------------- | ||
+ | </ | ||
+ | On peut voir ici que certbot modifie votre fichier de conf apache et crée une nouvelle config apache pour **-le-ssl.conf**, | ||
+ | |||
+ | Maintenant ajoutez le code suivant dans votre **main.cf** | ||
+ | < | ||
+ | # logging | ||
+ | smtpd_tls_loglevel = 1 | ||
+ | # Allow use of TLS but make it optional | ||
+ | smtp_use_tls=yes | ||
+ | # Disable SSLv2/3 as they are vulnerable | ||
+ | smtpd_tls_protocols = !SSLv2, !SSLv3 | ||
+ | smtp_tls_protocols = !SSLv2, !SSLv3 | ||
+ | # Insist on stronger ciphers | ||
+ | smtpd_tls_ciphers = high | ||
+ | smtp_tls_ciphers = high | ||
+ | # keys | ||
+ | smtp_tls_cert_file = / | ||
+ | smtp_tls_key_file = / | ||
+ | </ | ||
+ | Restartez votre postfix | ||
+ | service postfix restart | ||
+ | |||
+ | et voila :) | ||
+ | * doc plus poussé => http:// |