[Postfixbuch-users] Postfix, TLS, SASL und MySQL

Patrick Ben Koetter p at state-of-mind.de
Do Apr 8 10:57:50 CEST 2004


Guten Morgen Thomas,
* Thomas Grieder <suse.liste at freesurf.ch> [040408 09:25]:
> Während mehreren Stunden versuchte ich Postfix mit TLS zum Laufen zu
> bringen.  Auf Seite Postfix war das kein Problem (gemäss c't 8/04).
> Das Problem liegt bei SASL. Ich schaffe es nicht, dass SASL die
> Benutzerdaten in der MySQL-Datenbank abfragt. In mysql.err habe ich
> keine Fehler. In mysql.log sind keine Einträge betreffend SASL. In
> mail.log habe ich folgende Fehler:
> 
> Apr  8 00:39:23 moon postfix/smtpd[1528]: warning: SASL authentication failure:
> Password verification failed
> Apr  8 00:39:23 moon postfix/smtpd[1528]: warning:
> mars.domain1.ch[192.168.0.12]: SASL PLAIN authentication failed
> Apr  8 00:39:24 moon postfix/smtpd[1528]: warning: SASL authentication problem:
> unable to open Berkeley db /etc/sasldb2:

Das sind die Standardwarnungen und sie sind nicht aussagekräftig.
SASL selbst loggt nach auth.*. Sieh mal in Deiner syslog.conf nach, ob
es da ein logfile dafür gibt und wenn, was da drin steht.
Warte noch damit, ich schlage Dir gleich eine andere Konfiguration vor
;)

> So wie es aussieht wird MySQL nicht verwendet. Wer kann mir da
> weiterhelfen? Da ich inzwischen den Überblick verloren habe, sind
> einige Dateien völlig verkonfiguriert... :-(
> 
> System: debian unstable
> Postfix: 2.0.19
> MySQL: 4.0.18
> SASL: 2.1.18
> libpam-mysql: 0.5.0

Also:
Cyrus-SASL.2.x kann selber direkt auf MySQL zugreifen; dafür mußt Du
nicht PAM bemühen.

Dazu mußt Du bei debian in der /etc/postfix/sasl/smtpd.conf in etwa
folgendes wählen:

# Global parameters
log_level: 3
pwcheck_method: auxprop
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5

# auxiliary Plugin parameters
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: localhost
sql_database: mail
sql_user: username
sql_passwd: password
sql_select: SELECT %p FROM users WHERE username = '%u' AND realm = '%r'
sql_usessl: no


> moon:/etc/postfix/sasl# postconf -m
> static
> nis
> dbm
> regexp
> environ
> proxy
> btree
> unix
> hash
> tcp
> mysql

mysql ist gut für Postfix. Hilft aber nichts für SASL.

> moon:~# postconf -n

> smtpd_enforce_tls = yes

Keine gute Idee, TLS _immer_ zu fordern. Clients, die kein TLS können,
werden nichts anliefern können, wenn Dein mail server ans Internet
angebunden ist.

> smtpd_recipient_restrictions = permit_sasl_authenticated
> reject_unknown_sender_domain    reject_non_fqdn_sender  permit_mynetworks
>  permit_sasl_authenticated       check_recipient_maps
> reject_unauth_destination       reject_unauth_destination
> permit_auth_destination permit

> smtpd_sasl_auth_enable = yes

Ok

> smtpd_sasl_local_domain =

OK

> smtpd_sasl_security_options = noanonymous

> moon:/etc/postfix/sasl# cat smtpd.conf
> pwcheck_mathod: saslauthd
> mech_list: plain login

Die mußt Du wie oben erwähnt ändern.

p at rick

-- 
Patrick Koetter <p at state-of-mind.de>
http://postfix.state-of-mind.de/patrick.koetter/
 
"By the time you're thirty you have grown up,
whether you acknowledge it or not."




Mehr Informationen über die Mailingliste Postfixbuch-users