Hallo Ubuntuusers,
ich habe ein Problem mit der SMTP Auth an einem Postfix in einem internen Netz.
Die Nutzer sind in einer MYSQL Datenbank hinterlegt und sollen über libsasl2-modules-sql abgerufen werden.
Ein Test der Funktion bringt nun folgendes:
Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 ************ ESMTP Postfix (Ubuntu) EHLO test.test 250-************ 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN AUTH LOGIN 334 VXNlcm5hbWU6 ********** 334 UGFzc3dvcmQ6 ****** 535 5.7.8 Error: authentication failed: authentication failure QUIT 221 2.0.0 Bye Connection closed by foreign host.
Diese Fehlermeldung findet sich auch in meiner mail.log wieder.
In der auth.log finde ich folgendes:
Dec 8 16:00:18 ***.***.***.*** postfix/smtpd[2036]: sql auxprop plugin using mysql engine Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin Parse the username ****@***** Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin try and connect to a host Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin trying to open db 'mail' on host '127.0.0.1' Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin Parse the username ******@***** Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin try and connect to a host Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin trying to open db 'mail' on host '127.0.0.1' Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin Parse the username *****@******* Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin try and connect to a host Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin trying to open db 'mail' on host '127.0.0.1' Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: begin transaction Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin create statement from userPassword **** ***** Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin doing query SELECT password FROM users WHERE email = '*****@******'; Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin create statement from cmusaslsecretPLAIN ******* ****** Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin doing query SELECT password FROM users WHERE email = '********@*****'; Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: commit transaction Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin Parse the username *******@***** Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin try and connect to a host Dec 8 16:00:39 ***.***.***.*** postfix/smtpd[2036]: sql plugin trying to open db 'mail' on host '127.0.0.1'
Eine Fehlermeldung kann ich nirgends finden. Die MYSQL-Statements in meiner mysql.log sind auch korrekt und geben das richtige Passwort zurück.
Fällt euch noch was dazu ein?
Viele Grüße
Simon
PS: Anbei meine Konfiguration. (Ist bis auf die SASL Einstellungen noch im Original)
postconf -n
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix inet_interfaces = all inet_protocols = ipv4 mailbox_size_limit = 0 mydestination = *************, localhost myhostname = ************ mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname recipient_delimiter = relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, check_relay_domains smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = smtpd_sasl_path = smtpd smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_gid_maps = static:8 virtual_mailbox_base = /var/mail/vmail virtual_mailbox_domains = ************* virtual_mailbox_maps = hash:/etc/vmail virtual_minimum_uid = 8 virtual_uid_maps = static:8
/etc/postfix/sasl/smtpd.conf
pwcheck_method: auxprop auxprop_plugin: sql mech_list: PLAIN LOGIN allow_plaintext: true sql_engine: mysql sql_hostnames: 127.0.0.1 sql_user: mail sql_passwd: ********** sql_database: mail sql_select: SELECT password FROM users WHERE email = '%u@%r'
EDIT: Typo in Benutzername. Peinlich.