Postfix » Historique » Version 13
Patrice Nadeau, 2014-10-24 12:39
| 1 | 13 | Patrice Nadeau | h1. Postfix |
|---|---|---|---|
| 2 | 1 | Patrice Nadeau | |
| 3 | 12 | Patrice Nadeau | > Issue : #16 |
| 4 | |||
| 5 | 5 | Patrice Nadeau | ---- |
| 6 | |||
| 7 | {{toc}} |
||
| 8 | |||
| 9 | 4 | Patrice Nadeau | http://www.postfix.org |
| 10 | |||
| 11 | 1 | Patrice Nadeau | Logiciel de courrier électronique permettant, le transfert de courrier électronique (Message Transfert Agent). |
| 12 | |||
| 13 | 4 | Patrice Nadeau | Souvent installé de base pour l’envoie des message du serveur à une adresse externe. |
| 14 | 5 | Patrice Nadeau | Si le serveur doit envoyer et recevoir des messages de et vers l’Internet, les items suivant sont obligatoire : |
| 15 | * Domaine : Un nom de domaine enregistrer et sa gestion disponible |
||
| 16 | 1 | Patrice Nadeau | * MX records : pour permettre la réception de courriel. |
| 17 | 5 | Patrice Nadeau | * SPF records : pour permettre l’envoie de messages sans être bannis par les « reverse lookup ». |
| 18 | 1 | Patrice Nadeau | |
| 19 | Un serveur de relai (SMTP) externe seras nécessaire pour envoyer des courriels vers l’Internet. |
||
| 20 | |||
| 21 | Les fichiers de configuration sont : |
||
| 22 | 5 | Patrice Nadeau | * _/etc/postfix/master.cf_ |
| 23 | * _/etc/postfix/main.cf_ |
||
| 24 | |||
| 25 | 13 | Patrice Nadeau | h2. Installation |
| 26 | 5 | Patrice Nadeau | |
| 27 | <pre><code class="bash"> |
||
| 28 | zypper install postfix |
||
| 29 | chkconfig -a postfix |
||
| 30 | rcpostfix start |
||
| 31 | # Ouvrir dans le pare-feu |
||
| 32 | yast firewall services add service=smtp zone=EXT |
||
| 33 | </code></pre> |
||
| 34 | |||
| 35 | 13 | Patrice Nadeau | h2. Configuration |
| 36 | 5 | Patrice Nadeau | |
| 37 | Si les courriels doivent sortir via un relai sur un autre serveur SMTP, modifier le fichier _/etc/postfix/main.cf_ : |
||
| 38 | <pre><code class="bash"> |
||
| 39 | # Inscrire votre serveur SMTP de sortie |
||
| 40 | relayhost = smtp_server |
||
| 41 | # Spécifier toutes les interfaces |
||
| 42 | inet_interfaces = all |
||
| 43 | # A la ligne mydestination, ajouter |
||
| 44 | $mydomain |
||
| 45 | # Permettre aux machines du réseau local, l'utilisation du serveur |
||
| 46 | smtpd_client_restrictions = permit_mynetworks |
||
| 47 | </code></pre> |
||
| 48 | > La ligne myhostname DOIT être la même que l’enregistrement DNS de type MX sur internet pour ce domaine. |
||
| 49 | 1 | Patrice Nadeau | |
| 50 | 13 | Patrice Nadeau | h2. Création de «blacklist» et de «whitelist». |
| 51 | 1 | Patrice Nadeau | |
| 52 | 6 | Patrice Nadeau | Informations provenant de : http://www.postfix.org/RESTRICTION_CLASS_README.html |
| 53 | 1 | Patrice Nadeau | |
| 54 | 6 | Patrice Nadeau | Fichier _/etc/postfix/main.cf_ |
| 55 | <pre><code class="bash"> |
||
| 56 | smtpd_recipient_restrictions = |
||
| 57 | check_sender_access hash: /etc/postfix/sender_access |
||
| 58 | </code></pre> |
||
| 59 | 1 | Patrice Nadeau | |
| 60 | 6 | Patrice Nadeau | Créer un fichier _/etc/postfix/sender_access_. |
| 61 | Placer à l’intérieur, l’adresse de courriel, le nom de domaine ou l’adresse IP avec l’une des options : |
||
| 62 | * OK |
||
| 63 | * REJECT |
||
| 64 | 1 | Patrice Nadeau | |
| 65 | 6 | Patrice Nadeau | Modifier le fichier _/etc/postfix/sender_access_ : |
| 66 | <pre><code class="bash"> |
||
| 67 | # myfriend.com OK |
||
| 68 | # myennemies.com REJECT |
||
| 69 | # myfriend@example.com OK |
||
| 70 | # junk@spam.com REJECT |
||
| 71 | # marketing@ REJECT |
||
| 72 | # theboss@ OK |
||
| 73 | # deals.marketing.com REJECT |
||
| 74 | # somedomain.com OK |
||
| 75 | 101.15.251.176 REJECT |
||
| 76 | </code></pre> |
||
| 77 | |||
| 78 | 7 | Patrice Nadeau | Relancer : |
| 79 | <pre><code class="bash"> |
||
| 80 | postmap /etc/postfix/sender_access |
||
| 81 | postfix reload |
||
| 82 | </code></pre> |
||
| 83 | |||
| 84 | 13 | Patrice Nadeau | h3. Utilisation de services de « blacklist » internet : |
| 85 | 7 | Patrice Nadeau | |
| 86 | Modifier le fichier _/etc/postfix/main.cf_ : |
||
| 87 | <pre><code class="bash"> |
||
| 88 | smtpd_recipient_restrictions = |
||
| 89 | reject_rbl_client zen.spamhaus.org, |
||
| 90 | reject_rhsbl_helo dbl.spamhaus.org, |
||
| 91 | reject_rhsbl_sender dbl.spamhaus.org, |
||
| 92 | </code></pre> |
||
| 93 | 6 | Patrice Nadeau | |
| 94 | 13 | Patrice Nadeau | h3. Alias |
| 95 | 10 | Patrice Nadeau | |
| 96 | Fichier _/etc/postfix/aliases_ |
||
| 97 | |||
| 98 | Création des alias avec |
||
| 99 | <pre><code class="bash"> |
||
| 100 | newaliases |
||
| 101 | </code></pre> |
||
| 102 | |||
| 103 | 13 | Patrice Nadeau | h3. Options courantes |
| 104 | 11 | Patrice Nadeau | |
| 105 | Dans _main.cf_ : |
||
| 106 | * *message_size_limit* : |
||
| 107 | |||
| 108 | 13 | Patrice Nadeau | h2. Entrés DNS |
| 109 | 6 | Patrice Nadeau | |
| 110 | 13 | Patrice Nadeau | h3. A record |
| 111 | 6 | Patrice Nadeau | |
| 112 | 13 | Patrice Nadeau | h3. MX record |
| 113 | 6 | Patrice Nadeau | |
| 114 | 13 | Patrice Nadeau | h3. SPF record |
| 115 | 6 | Patrice Nadeau | |
| 116 | 2 | Patrice Nadeau | Ajouter ceux du fournisseur internet (le fournisseur et et tous ses abonnées pourront "se faire passer" pour le domaine) |
| 117 | |||
| 118 | 13 | Patrice Nadeau | h2. Test |
| 119 | 2 | Patrice Nadeau | |
| 120 | 13 | Patrice Nadeau | h3. SPF |
| 121 | 3 | Patrice Nadeau | |
| 122 | Envoyer un courriel à une des adresses suivantes : |
||
| 123 | * check-auth@verifier.port25.com |
||
| 124 | 6 | Patrice Nadeau | * check-auth2@verifier.port25.com |
| 125 | 8 | Patrice Nadeau | |
| 126 | 13 | Patrice Nadeau | h2. Dépannage |
| 127 | 8 | Patrice Nadeau | |
| 128 | La commande *mailq* permet de voir les requêtes en attentes. |