Bonjour.
Je possède un serveur sous ubuntu, et je cherchais à installer postfix + roundcube + dovecot.
Ce qui s'est déroulé sans trop de problème, avec quelques embuches tout fini par fonctionner.
Cependant, je me confronte à une erreur que le web n'a pas encore solutionné visiblement alors je viens vers vous pour vous demander si vous n'auriez pas une solution à mon problème.
Je debug en temps réel ce qui se passe via la commande
tail -f /var/log/dovecot* /var/log/mail.log
Et lors de la réception du mail, voici la log qui apparait (avec les informations remplacées par ------).
Nov 25 12:59:41 ----- postfix/qmgr[4867]: 48C4FA00A4B: from=<------>, size=2527, nrcpt=1 (queue active)
Nov 25 12:59:41 ----- postfix/smtpd[18990]: disconnect from mail-ej1-f50.google.com[------] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Nov 25 12:59:41 ----- postfix/smtp[18993]: 48C4FA00A4B: to=<------>, relay=none, delay=0.04, delays=0.03/0.01/0.01/0, dsn=5.4.6, status=bounced (mail for localhost loops back to myself)
Nov 25 12:59:41 ----- postfix/cleanup[18992]: 53364A00D7C: message-id=<20201125125941.53364A00D7C@------>
Nov 25 12:59:41 ----- postfix/bounce[18994]: 48C4FA00A4B: sender non-delivery notification: 53364A00D7C
Nov 25 12:59:41 ----- postfix/qmgr[4867]: 53364A00D7C: from=<>, size=4415, nrcpt=1 (queue active)
Nov 25 12:59:41 ----- postfix/qmgr[4867]: 48C4FA00A4B: removed
On voit que le problème est le log:
mail for localhost loops back to myself
Voici le contenu du fichier /etc/postfix/main.cf
# GENERAL SETTINGS
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
append_dot_mydomain = no
readme_directory = no
# SMTP SETTINGS
smtp_use_tls=yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# SMTPD SETTINGS
smtpd_use_tls=yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.-----/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.-----/privkey.pem
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
# SASL SETTINGS
relay_domains = localhost.local
transport_maps = hash:/etc/postfix/transport
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
# VIRTUAL MAIL BOX AND LMTP SETTINGS
virtual_transport = lmtp:unix:private/dovecot-lmtp
#virtual_mailbox_domains = /etc/postfix/virtual_mailbox_domains
# OTHER SETTINGS
myhostname = -----
myorigin = /etc/mailname
mydestination = -----, localhost.$mydomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter =
inet_interfaces = all
inet_protocols = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
compatibility_level = 2
default_transport=smtp
Contenu du fichier /etc/hosts
127.0.0.1 localhost
127.0.0.1 localhost.local
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Si quelqu'un pouvait m'aider ce serait très cool svp 🙂
Bonne journée, merci d'avance