Bonjour,
Je tente d’installer et configurer Postifx/Dovecot sur Debian Buster.
A noter que la procédure suivante je l’ai utilisé pour la dernière fois sur une 8.6 et que cela fonctionnait très bien.
Je n’ai aucune idée du blocage et de ce qui a pu changer depuis.
J’ai cherché plusieurs jours mais je n’ai pas réussi à trouver ma réponse.
Voici mes fichiers de configuration :
/etc/postfix/main.cf
Résumé
smtpd_helo_required = yes
smtpd_delay_reject = yes
virtual_uid_maps = static:3000
virtual_gid_maps = static:3000
virtual_mailbox_base = /home/facteur
virtual_transport = dovecot
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
smtpd_recipient_restrictions =
check_sender_access hash:/etc/postfix/sender_access,
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
delay_warning_time = 1h
dovecot_destination_recipient_limit = 1
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ns1.euuuhhh.tld
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, ns1.euuuhhh.tld, localhost.euuuhhh.tld, , localhost
relayhost =
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
/etc/postfix/master.cf
Résumé
smtp inet n - y - - smtpd
pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 bounce
verify unix - - y - 1 verify
flush unix n - y 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
-o syslog_name=postfix/$service_name
showq unix n - y - - showq
error unix - - y - - error
retry unix - - y - - error
discard unix - - y - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - y - - lmtp
anvil unix - - y - 1 anvil
scache unix - - y - 1 scache
postlog unix-dgram n - n - 1 postlogd
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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}
dovecot unix - n n - - pipe
flags=DRhu user=facteur:facteur argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
/etc/dovecot/dovecot.conf
Résumé
log_timestamp = "%Y-%m-%d %H:%M:%S "
disable_plaintext_auth = no
mail_location = maildir:/home/facteur/%d/%n:INDEX=/home/facteur/%d/%n/indexes
mail_privileged_group = mail
protocols = imap pop3
protocol lda {
postmaster_address = contact@funnyhost.fr
mail_plugin_dir = /usr/lib/dovecot/modules/lda
auth_socket_path = /var/run/dovecot/auth-master
}
ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key
userdb {
args = /etc/dovecot/dovecot-mysql.conf
driver = sql
}
passdb {
args = /etc/dovecot/dovecot-mysql.conf
driver = sql
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-master {
mode = 0600
user = facteur
}
}
auth_mechanisms = plain login
La première erreur que j’ai eu était à cause du fichier manquant :
/var/spool/postfix/plesk/blacklists
Je l’ai créé (sans savoir ce que ca pouvait contenir)
et voici l’erreur suivante :
Résumé
Jul 23 09:30:45 ns1 postfix/smtpd[20799]: connect from unknown[45.xx.xx.xx]
Jul 23 09:31:02 ns1 postfix/smtpd[20799]: warning: unknown[45.xx.xx.xx]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Jul 23 09:31:02 ns1 postfix/smtpd[20799]: disconnect from unknown[45.xx.xx.xx] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Jul 23 09:31:22 ns1 postfix/smtpd[20781]: connect from unknown[45.xx.xx.xx]
Jul 23 09:31:24 ns1 postfix/smtpd[20799]: connect from unknown[45.xx.xx.xx]
Jul 23 09:31:29 ns1 postfix/smtpd[20781]: warning: unknown[45.xx.xx.xx]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Jul 23 09:31:29 ns1 postfix/smtpd[20781]: disconnect from unknown[45.xx.xx.xx] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Jul 23 09:31:33 ns1 postfix/smtpd[20799]: warning: unknown[45.xx.xx.xx]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Jul 23 09:31:34 ns1 postfix/smtpd[20799]: disconnect from unknown[45.xx.xx.xx] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Jul 23 09:32:03 ns1 postfix/smtpd[20781]: connect from unknown[45.xx.xx.xx]
Jul 23 09:32:04 ns1 postfix/pickup[20778]: 51EAC5C006F: uid=0 from=<root@ns1.euuuhhh.tld>
Jul 23 09:32:04 ns1 postfix/cleanup[20819]: 51EAC5C006F: message-id=<20190723093204.51EAC5C006F@ns1.euuuhhh.tld>
Jul 23 09:32:04 ns1 postfix/qmgr[20779]: 51EAC5C006F: from=<root@ns1.euuuhhh.tld>, size=352, nrcpt=1 (queue active)
Jul 23 09:32:04 ns1 dovecot: lda(contact@euuuhhh.tld)<20828><5NcSHRTUNl1cUQAAbgMozA>: msgid=<20190723093204.51EAC5C006F@ns1.euuuhhh.tld>: saved mail to INBOX
Jul 23 09:32:04 ns1 postfix/pipe[20826]: 51EAC5C006F: to=<contact@euuuhhh.tld>, relay=dovecot, delay=0.28, delays=0.17/0.02/0/0.09, dsn=2.0.0, status=sent (delivered via dovecot service (lda(contact@euuuhhh.tld,)Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission ))
Jul 23 09:32:04 ns1 postfix/qmgr[20779]: 51EAC5C006F: removed
Je n’arrive pas à comprendre le problème
Dans le fichier /etc/dovecot/dovecot.conf
j’ai ajouté :
Résumé
service stats {
unix_listener stats-reader {
user = facteur
group = facteur
mode = 0660
}
unix_listener stats-writer {
user = facteur
group = facteur
mode = 0660
}
}
Mais j’ai toujours certaines erreurs que je ne comprends pas :
Résumé
Jul 23 09:44:27 ns1 postfix/smtpd[20781]: disconnect from unknown[45.xx.xx.xx] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Jul 23 09:44:51 ns1 postfix/smtpd[20799]: connect from unknown[45.xx.xx.xx]
Jul 23 09:44:54 ns1 postfix/smtpd[20799]: warning: SASL: Connect to private/auth failed: Connection refused
Jul 23 09:44:54 ns1 postfix/smtpd[20799]: warning: unknown[45.xx.xx.xx]: SASL LOGIN authentication failed:
Jul 23 09:44:55 ns1 postfix/smtpd[20799]: disconnect from unknown[45.xx.xx.xx] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Jul 23 09:44:55 ns1 postfix/smtpd[20781]: connect from unknown[45.xx.xx.xx]
Jul 23 09:44:55 ns1 postfix/smtpd[20781]: warning: SASL: Connect to private/auth failed: Connection refused
Jul 23 09:44:55 ns1 postfix/smtpd[20781]: fatal: no SASL authentication mechanisms
Jul 23 09:44:56 ns1 postfix/master[20777]: warning: process /usr/lib/postfix/sbin/smtpd pid 20781 exit status 1
Jul 23 09:45:04 ns1 dovecot: master: Dovecot v2.3.4.1 (f79e8e7e4) starting up for imap, pop3 (core dumps disabled)
Jul 23 09:45:05 ns1 postfix/pickup[20778]: E694C5C0073: uid=0 from=<root@ns1.euuuhhh.tld>
Jul 23 09:45:05 ns1 postfix/cleanup[21026]: E694C5C0073: message-id=<20190723094505.E694C5C0073@ns1.euuuhhh.tld>
Jul 23 09:45:06 ns1 postfix/qmgr[20779]: E694C5C0073: from=<root@ns1.euuuhhh.tld>, size=352, nrcpt=1 (queue active)
Jul 23 09:45:06 ns1 dovecot: lda(contact@euuuhhh.tld)<21050><D6lFBSLXNl06UgAAbgMozA>: msgid=<20190723094505.E694C5C0073@ns1.euuuhhh.tld>: saved mail to INBOX
Jul 23 09:45:06 ns1 postfix/pipe[21029]: E694C5C0073: to=<contact@euuuhhh.tld>, relay=dovecot, delay=0.28, delays=0.16/0/0/0.11, dsn=2.0.0, status=sent (delivered via dovecot service)
Jul 23 09:45:06 ns1 postfix/qmgr[20779]: E694C5C0073: removed
Jul 23 09:45:08 ns1 postfix/anvil[20784]: statistics: max connection rate 2/60s for (smtp:45.xx.xx.xx) at Jul 23 09:35:20
Jul 23 09:45:08 ns1 postfix/anvil[20784]: statistics: max connection count 1 for (smtp:45.xx.xx.xx) at Jul 23 09:35:20
Jul 23 09:45:34 ns1 postfix/smtpd[20799]: connect from unknown[45.xx.xx.xx]
Si je fais un telnet
:
Résumé
telnet 91.xx.xx.xx 25
Trying 91.xx.xx.xx...
Connected to 91.xx.xx.xx.
Escape character is '^]'.
220 ns1.euuuhh.tld ESMTP Postfix (Debian/GNU)
EHLO ns1.euuuhh.tld
250-ns1.euuuhh.tld
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
AUTH LOGIN xxxxxxxx
334 UGFzc3dvcmQ6
xxxxxxxxxx
235 2.7.0 Authentication successful
mail from:contact@euuuhh.tld
250 2.1.0 Ok
rcpt to:contact@euuuhh.tld
451 4.3.5 <contact@euuuhh.tld>: Sender address rejected: Server configuration error
J’ai essayé de supprimer le fichier
/var/spool/postfix/plesk/blacklists
pour vous montrer l’erreur, mais elle ne se produit plus… Bizarre.
Auriez-vous une idée du problème ?
Je vous remercie par avance