Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
postfix [Le 06/10/2023, 13:53] – [Pré-requis] 193.49.62.56postfix [Le 02/10/2025, 17:14] (Version actuelle) – Suppression d'espaces doublés dans certaines commandes 65.39.73.58
Ligne 5: Ligne 5:
 Voir [[:Comment configurer sa distribution de courriels systèmes MTA|Comment configurer sa distribution de courriels systèmes MTA ?]] qui se propose de reprendre cette partie pour postfix… Voir [[:Comment configurer sa distribution de courriels systèmes MTA|Comment configurer sa distribution de courriels systèmes MTA ?]] qui se propose de reprendre cette partie pour postfix…
  
-=== Postfix : agent de transfert de courriel (SMTP) ===+====== Postfix : agent de transfert de courriel (SMTP) ======
  
 **Postfix** est l'agent de transfert de courriel (MTA) par défaut d'Ubuntu. **Postfix** est l'agent de transfert de courriel (MTA) par défaut d'Ubuntu.
Ligne 18: Ligne 18:
   * Disposer des [[:sudo|droits d'administration]].   * Disposer des [[:sudo|droits d'administration]].
   * Disposer d'une connexion à Internet configurée et activée.   * Disposer d'une connexion à Internet configurée et activée.
-  * Connaitre Nassim FOIN le pointeur 
-  * Bz des chèvres comme Six 
-  * Voir mael parler au RT1 (filles) 
- 
  
 ===== Installation ===== ===== Installation =====
Ligne 42: Ligne 38:
   sudo dpkg-reconfigure postfix   sudo dpkg-reconfigure postfix
  
-Lorsqu'on vous les demande, entrez les détails suivants (remplacez theofoin.fr par votre nom de domaine) :+Lorsqu'on vous les demande, entrez les détails suivants (remplacez server1.exemple.com par votre nom de domaine) :
  
    Internet Site    Internet Site
    NONE    NONE
-   theofoin.fr +   server1.exemple.com 
-   theofoin.fr, localhost.theofoin.fr, localhost+   server1.exemple.com, localhost.exemple.com, localhost
    No    No
    127.0.0.0/8    127.0.0.0/8
Ligne 56: Ligne 52:
  
   sudo postconf -e 'smtpd_sasl_local_domain ='   sudo postconf -e 'smtpd_sasl_local_domain ='
-  sudo  postconf -e 'smtpd_sasl_auth_enable = yes' +  sudo postconf -e 'smtpd_sasl_auth_enable = yes' 
-  sudo  postconf -e 'smtpd_sasl_security_options = noanonymouse+  sudo postconf -e 'smtpd_sasl_security_options = noanonymous
-  sudo  postconf -e 'broken_sasl_auth_client = yes' +  sudo postconf -e 'broken_sasl_auth_clients = yes' 
-  sudo   postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticate,permit_mynetwork,reject_unauth_destination' +  sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination' 
-  sudo  postconf -e 'inet_interfaces = all'+  sudo postconf -e 'inet_interfaces = all'
  
-  sudo  touch /etc/postfix/sasl/smtpd.conf+  sudo touch /etc/postfix/sasl/smtpd.conf
   sudo su   sudo su
   echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf   echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
Ligne 71: Ligne 67:
   sudo openssl genrsa -des3 -rand /dev/urandom -out smtpd.key 2048   sudo openssl genrsa -des3 -rand /dev/urandom -out smtpd.key 2048
   sudo openssl req -new -key smtpd.key -out smtpd.csr   sudo openssl req -new -key smtpd.key -out smtpd.csr
-  sudo  openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt+  sudo openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
   sudo openssl rsa -in smtpd.key -out smtpd.key.unencrypted   sudo openssl rsa -in smtpd.key -out smtpd.key.unencrypted
-  sudo mv -f smtpd.key.unencrypted smtpd.khey+  sudo mv -f smtpd.key.unencrypted smtpd.key
   sudo chmod 600 smtpd.key   sudo chmod 600 smtpd.key
   sudo openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650    sudo openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 
Ligne 81: Ligne 77:
   sudo postconf -e 'smtpd_use_tls = yes'   sudo postconf -e 'smtpd_use_tls = yes'
   sudo postconf -e 'smtp_tls_note_starttls_offer = yes'   sudo postconf -e 'smtp_tls_note_starttls_offer = yes'
-  sudo postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.khey'+  sudo postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
   sudo postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'   sudo postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
   sudo postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'   sudo postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
Ligne 88: Ligne 84:
   sudo postconf -e 'smtpd_tls_session_cache_timeout = 3600s'   sudo postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
   sudo postconf -e 'tls_random_source = dev:/dev/urandom'   sudo postconf -e 'tls_random_source = dev:/dev/urandom'
-  sudo postconf -e 'myhostname = theofoin.fr+  sudo postconf -e 'myhostname = server1.example.com
      
 [[:tutoriel:comment_modifier_un_fichier|Éditez le fichier]] __/etc/postfix/main.cf__ qui doit ressembler à ceci : [[:tutoriel:comment_modifier_un_fichier|Éditez le fichier]] __/etc/postfix/main.cf__ qui doit ressembler à ceci :
Ligne 104: Ligne 100:
 #delay_warning_time = 4h #delay_warning_time = 4h
  
-myhostname = theofoin.fr +myhostname = server1.example.com 
-alias_map = hash:/etc/aliases+alias_maps = hash:/etc/aliases
 alias_database = hash:/etc/aliases alias_database = hash:/etc/aliases
 myorigin = /etc/mailname myorigin = /etc/mailname
-mydestination = theofoin.fr, localhost.theofoin.fr, localhost+mydestination = server1.example.com, localhost.example.com, localhost
 relayhost = relayhost =
-mynetwork = 127.0.0.0/8+mynetworks = 127.0.0.0/8
 mailbox_size_limit = 0 mailbox_size_limit = 0
 recipient_delimiter = + recipient_delimiter = +