Mysql courier: authdaemond: failed to connect to mysql

bonjour,

J’avais commencé avec dovecot, mai pas moyen…bref donc installer courrier,
qui a un fichier de configuration plus simple.
Mai qui surtout permet d’avoir des erreur plus claires dans les log (c’ est relatif mai bon)

voici l’erreur quand je tente de me récupérer mes mail avec icedove (Thunderbird):

Aug 13 12:49:13 postserv authdaemond: failed to connect to mysql server (server=localhost, userid=postfix): Access denied for user 'postfix'@'localhost' (using password: YES)
Aug 13 12:49:13 postserv pop3d: LOGIN FAILED, method=PLAIN, ip=[::ffff:184.724.119.14]
etc etc.

2 test:

authtest postfix@localhost
Authentication FAILED: Input/output error

authtest postfix@localhost $$mxxxxtop$$ Authentication FAILED: Operation not permitted

Je peux recevoir les mail. le répertoire est bien crée.
j’en déduits que postfix peux donc bien travailler avec mysql.

cat /etc/courier/authmysqlrc
MYSQL_PORT              3306
#MYSQL_PORT             0
MYSQL_OPT               0
MYSQL_SERVER            localhost
MYSQL_SOCKET /run/mysqld/mysqld.sock
MYSQL_USERNAME postfix
MYSQL_PASSWORD $$mxxxxtop$$
MYSQL_DATABASE postfix
MYSQL_USER_TABLE comptes
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/var/spool/vmail/"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
+--------------------+------+
| domaine            | etat |
+--------------------+------+
| doamaines.com      |    1 |
+--------------------+------+
1 row in set (0.00 sec)

mysql> SELECT * FROM comptes;
+-----------------------------------+-------------------------------------------+-------+------+------+------+
| email                             | password                                  | quota | etat | imap | pop3 |
+-----------------------------------+-------------------------------------------+-------+------+------+------+
| user@domaine.com                  | *F2F8F070D2072DFG05BF64A254234AAF5C51EB9  |     0 |    1 |    1 |    1  |
+-----------------------------------+-------------------------------------------+-------+------+------+------+
 select version();
+-----------------+
| version()       |
+-----------------+
| 5.5.44-0+deb8u1 |
+-----------------+
 postconf -n
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
disable_vrfy_command = yes
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = localhost
myhostname = postserv
mynetworks = 127.0.0.1
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (GNU)
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_invalid_helo_hostname, reject_unlisted_sender, reject_unknown_sender_domain, reject_sender_login_mismatch, reject_authenticated_sender_login_mismatch, reject_unauth_destination, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, permit
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_comptes.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vmail/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_comptes.cf
virtual_uid_maps = static:5000
cat /etc/courier/pop3d
##VERSION: $Id: 2013-08-19 16:39:41 -0400 9c45d9ad13fdf439d44d7443ae75da15ea0223ed$
#
# pop3d created from pop3d.dist by sysconftool
#
# Do not alter lines that begin with ##, they are used when upgrading
# this configuration.
#
#  Copyright 1998 - 2011 Double Precision, Inc.  See COPYING for
#  distribution information.
#
#  Courier POP3 daemon configuration
#
##NAME: PIDFILE:0
#

PIDFILE=/var/run/courier/pop3d.pid

##NAME: MAXDAEMONS:0
#
#  Maximum number of POP3 servers started
#

MAXDAEMONS=40

##NAME: MAXPERIP:4
#
#  Maximum number of connections to accept from the same IP address

MAXPERIP=4

##NAME: POP3AUTH:1
#
# To advertise the SASL capability, per RFC 2449, uncomment the POP3AUTH
# variable:
#
# POP3AUTH="LOGIN"
#
# If you have configured the CRAM-MD5, CRAM-SHA1 or CRAM-SHA256, set POP3AUTH
# to something like this:
#
#POP3AUTH="LOGIN CRAM-MD5 CRAM-SHA1"

POP3AUTH="PLAIN LOGIN CRAM-MD5 CRAM-SHA1 CRAM-SHA2 CRAM-SHA256"

##NAME: POP3AUTH_ORIG:1
#
# For use by webadmin

POP3AUTH_ORIG="PLAIN LOGIN CRAM-MD5 CRAM-SHA1 CRAM-SHA256"

##NAME: POP3AUTH_TLS:1
#
# To also advertise SASL PLAIN if SSL is enabled, uncomment the
# POP3AUTH_TLS environment variable:
#
# POP3AUTH_TLS="LOGIN PLAIN"

POP3AUTH_TLS="LOGIN PLAIN"

##NAME: POP3AUTH_TLS_ORIG:0
#
# For use by webadmin

POP3AUTH_TLS_ORIG="LOGIN PLAIN"

##NAME: POP3_PROXY:0
#
# Enable proxying.  See README.proxy

POP3_PROXY=0

##NAME: PROXY_HOSTNAME:0
#
# Override value from gethostname() when checking if a proxy connection is
# required.

# PROXY_HOSTNAME=

##NAME: PORT:1
#
# Port to listen on for connections.  The default is port 110.
#
#  Multiple port numbers can be separated by commas.  When multiple port
#  numbers are used it is possibly to select a specific IP address for a
#  given port as "ip.port".  For example, "127.0.0.1.900,192.68.0.1.900"
#  accepts connections on port 900 on IP addresses 127.0.0.1 and 192.68.0.1
#  The ADDRESS setting is a default for ports that do not have a specified
#  IP address.

PORT=110

##NAME: ADDRESS:0
#
# IP address to listen on.  0 means all IP addresses.

ADDRESS=0

##NAME: AUTHSERVICE:0
#
#  It's possible to authenticate using a different 'service' parameter
#  depending on the connection's port.  This only works with authentication
#  modules that use the 'service' parameter, such as PAM.  Example:
#
#  AUTHSERVICE110=pop3
#  AUTHSERVICE995=pop3s

##NAME: TCPDOPTS:0
#
# Other couriertcpd(1) options.  The following defaults should be fine.
#

TCPDOPTS="-nodnslookup -noidentlookup"

##NAME: LOGGEROPTS:0
#
# courierlogger(1) options.
#

LOGGEROPTS="-name=pop3d"

##NAME: DEFDOMAIN:0
#
# Optional default domain. If the username does not contain the
# first character of DEFDOMAIN, then it is appended to the username.
# If DEFDOMAIN and DOMAINSEP are both set, then DEFDOMAIN is appended
# only if the username does not contain any character from DOMAINSEP.
# You can set different default domains based on the the interface IP
# address using the -access and -accesslocal options of couriertcpd(1).

#DEFDOMAIN="@example.com"

##NAME: POP3DSTART:0
#
# POP3DSTART is not referenced anywhere in the standard Courier programs
# or scripts.  Rather, this is a convenient flag to be read by your system
# startup script in /etc/rc.d, like this:
#
#  . /etc/courier/pop3d
#  case x$POP3DSTART in
#  x[yY]*)
#        /usr/lib/courier/pop3d.rc start
#        ;;
#  esac
#
# The default setting is going to be NO, until Courier is shipped by default
# with enough platforms so that people get annoyed with having to flip it to
# YES every time.

POP3DSTART=YES

##NAME: POP3_LOG_DELETIONS:0
#
#
# Set POP3_LOG_DELETIONS to log all message deletions to syslog.
#
# POP3_LOG_DELETIONS=1


##NAME: MAILDIRPATH:0
#
# MAILDIRPATH - directory name of the maildir directory.
#
MAILDIRPATH=Maildir

j’utilise un tutoriel ici:
http://www.tutoriels-video.fr/installation-et-configuration-dun-serveur-de-mail-avec-postfix-et-courier/
dans les commantaire il semblerai que je ne soie pas le seul a chercher la cause, google sort plein de post… mais on fini par si perdre.

Je commance a me demander si mysql a stoquer le mots de passe dans un format correct ?
sur le site de mysql on peux y lire que les mots de passe on évoluer.

SET PASSWORD FOR 'user'@'mondomaine' = OLD_PASSWORD('le bon'); (donc pas postfix@localhost)
ls -la /etc/courier/
total 112
drwxr-xr-x  3 root   root    4096 août  13 12:55 .
drwxr-xr-x 80 root   root    4096 août  13 12:45 ..
-rw-rw----  1 daemon daemon  3696 août  13 09:56 authdaemonrc
-rw-rw----  1 daemon daemon   453 août  13 12:12 authmysqlrc
-rw-r-----  1 root   root    8803 août  13 07:51 authmysqlrc.orig
-rw-------  1 daemon root     201 août  13 09:32 dhparams.pem
-rw-r--r--  1 root   root   15320 janv. 25  2015 imapd
-rw-------  1 daemon daemon   350 janv. 25  2015 imapd.cnf
-rw-------  1 daemon root    5419 août  13 12:55 imapd.pem
-rw-r--r--  1 root   root    9369 janv. 25  2015 imapd-ssl
-rw-r--r--  1 root   root      18 janv. 25  2015 maildrop
-rw-r--r--  1 root   root    3822 août  13 12:31 pop3d
-rw-------  1 daemon daemon   350 janv. 25  2015 pop3d.cnf
-rw-r--r--  1 root   root    3760 août  13 09:16 pop3d.orig
-rw-------  1 daemon root    5419 août  13 09:32 pop3d.pem
-rw-r--r--  1 root   root    8373 janv. 25  2015 pop3d-ssl
drwxr-xr-x  2 daemon daemon  4096 août  13 07:50 shared
ls -la /var/spool/vmail/
total 24
drwxr-xr-x 3 vmail vmail 4096 août   9 12:55 .
drwxr-xr-x 6 root  root  4096 août   8 22:19 ..
-rw-r--r-- 1 vmail vmail  220 oct.   7  2014 .bash_logout
-rw-r--r-- 1 vmail vmail 3515 oct.   7  2014 .bashrc
drwx------ 3 vmail vmail 4096 août   9 12:55 domaines.com
-rw-r--r-- 1 vmail vmail  675 oct.   7  2014 .profile
ls -la /var/spool/vmail/domaines.com/user/
drwx------ 5 vmail vmail 4096 août   9 12:55 .
drwx------ 3 vmail vmail 4096 août   9 12:55 ..
drwx------ 2 vmail vmail 4096 août   9 12:55 cur
drwx------ 2 vmail vmail 4096 août  11 12:35 new
drwx------ 2 vmail vmail 4096 août  11 12:35 tmp

Merci d’avance

utiliser encrypt résout le problème:)

Salut, je rencontre le même problème, par contre j’ai pas compris comment vous avez résolu ça, utiliser encrypt ? Où ca ? D’ailleurs je suis entrain de suivre le même tuto sur tutoriels-video…