ubuntuusers.de

postfix smtpd auth mit sasldb/berkeley Problem

Status: Ungelöst | Ubuntu-Version: Ubuntu 6.10 (Edgy Eft)
Antworten |

bluba

Anmeldungsdatum:
7. Mai 2006

Beiträge: Zähle...

Hallo!

Ich bin schon mal froh, dass ich postfix für mehrere relayhost konfiguriert habe und die verschiedenen Benutzer aus der Kommandozeile mit mail Emails verschicken können. Sogar GMX nimmt die Mails an!
Jetzt möchte ich aber auch aus beliebigen Email-Clients heraus Mails verschicken können, und habe dazu den smtpd von postfix konfiguriert. Problem hierbei ist der Anmeldevorgang. Ich wollte die Authentifizierung über die sasldb machen.

Da ich mich jetzt schon mehrere Tage mit diesem einen Problem beschäftige und langsam den Wald vor lauter Bäumen nicht mehr sehe, hoffe ich, dass es nur ein einfacher Fehler ist, der schnell zu beseitigen ist!

Fehler:

SASL authentication failed: authentication failure


Egal, ob ich's "per Hand" über telnet mit AUTH PLAIN versuche, oder über Evolution mit Anmelden, CRAM-MD5, usw.

In der mail.log finden sich genauere Infos:

Nov 22 14:12:45 ubuntu-server postfix/smtpd[3870]: connect from localhost[127.0.0.1]
Nov 22 14:13:28 ubuntu-server postfix/smtpd[3870]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Nov 22 14:13:28 ubuntu-server postfix/smtpd[3870]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Nov 22 14:13:28 ubuntu-server postfix/smtpd[3870]: warning: SASL authentication failure: Password verification failed
Nov 22 14:13:28 ubuntu-server postfix/smtpd[3870]: warning: localhost[127.0.0.1]: SASL PLAIN authentication failed: authentication failure
Nov 22 14:13:30 ubuntu-server postfix/smtpd[3870]: disconnect from localhost[127.0.0.1]

Jetzt könnte man meinen, es gäbe die /etc/sasldb2 nicht, ABER:

ls -l sasldb2
-rw-rw-rw- 1 postfix nogroup 12288 2006-11-22 14:11 sasldb2


Und sie wurde natürlich auch mit saslpasswd2 gefüllt.

Installiert ist:
postfix-tls (2.3.3-1)
libdb4.3
und so ziemlich alles von sasl2-bin bis libsasl2-modules

Ist vielleicht die falsche Berkeley DB installiert?

Noch ein Fehler, mit dem ich gar nichts anfangen kann aus der auth.log:

Nov 22 13:46:01 ubuntu-server postfix/smtpd[3634]: OTP unavailable because can't read/write key database /etc/opiekeys: No such file or directory


Die Datei gab es wirklich nicht, und ich hab einfach mal versucht, die sasl2db nach opiekeys zu kopieren, hat aber auch nichts geändert. Was ist den OTP überhaupt? Darüber habe ich noch nichts gelesen.

Und noch meine Config:
/etc/postfix/master.cf:

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_enforce_tls=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
	-o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache	  unix	-	-	-	-	1	scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
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}


Da smtp wie man sieht nicht im chroot läuft, muss ich doch auch nichts nach /var/spool/postfix kopieren, oder?

/etc/postfix/main.cf:

...
# Ausgehend
sender_dependent_relayhost_maps = hash:/etc/postfix/relaymaps
sender_dependent_authentication = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_type = cyrus
smtp_sasl_security_options = noanonymous
canonical_maps = hash:/etc/postfix/canonical

# Eingehend
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_receipient_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_sasl_local_domain = 
broken_sasl_auth_clients = yes

/etc/postfix/sasl/smtpd.conf:

pwcheck_method: auxprop


Hab irgendwo im Netz gelesen, für sasl2 müsste es /etc/postfix/sasl2/smtpd.conf sein, hab's einfach kopiert, dass es beides gibt, aber hat auch nichts gebracht. Auch alle Module (die lib...) hab ich ins Verzeichnis von smtpd.conf geschoben, hat aber auch nichts verändert.
Nur wenn ich hier saslauthd als Methode angebe, muss dieser daemon auch gestartet werden, oder? Ich hab's für alles fälle mal mit und mal ohne Probiert, geht trotzdem nicht.

Ich hoffe, dass mir jemand helfen kann! Wenn noch mehr logs oder conf dateien benötigt werden, poste ich sie gern auch noch!!

Danke schon mal an alle!!

Gruß, bluba

otzenpunk Team-Icon

Avatar von otzenpunk

Anmeldungsdatum:
17. Oktober 2005

Beiträge: 8691

Wohnort: Hamburg-Altona

bluba hat geschrieben:

Noch ein Fehler, mit dem ich gar nichts anfangen kann aus der auth.log:

Nov 22 13:46:01 ubuntu-server postfix/smtpd[3634]: OTP unavailable because can't read/write key database /etc/opiekeys: No such file or directory


Die Datei gab es wirklich nicht, und ich hab einfach mal versucht, die sasl2db nach opiekeys zu kopieren, hat aber auch nichts geändert. Was ist den OTP überhaupt? Darüber habe ich noch nichts gelesen.

Das hat wirklich gar nichts mit deinem Problem zu tun. OTP ist die Abkürzung für "One-Time-Passwords", ein Verfahren ähnlich den TANs bei Banküberweisungen. Keine Ahnung, warum Postfix davon ausgeht, das evtl. benutzen zu können. Kannst du aber ignorieren.

Was das andere Problem angeht: Was sagt der Befehl sasldblistusers2

Deine Dateirechte für /etc/sasldb2 sehen auch sehr merkwürdig aus. Eine Passwortdatei, die world-readable/-writable ist, sollte man auf jeden Fall vermeiden. Bei mir sieht die Datei so aus:

$ ll /etc/sasldb2 
-rw-rw----  1 root sasl 12288 Jun 18  2005 /etc/sasldb2


Alle Benutzer, die SASL benutzen möchten, (bei mir nur cyrus, bei dir postfix,) müssen dann nur der Gruppe sasl hinzugefügt werden.

bluba

(Themenstarter)

Anmeldungsdatum:
7. Mai 2006

Beiträge: 4

Hallo!

Ja, mit den Dateirechten hat das so einen Grund: Nachdem postfix die Datei nicht gefunden hat, hatte ich einfach mal die Dateirechte erweitert. Das hat aber nichts geholfen. Hatte nur vergessen, es wieder zurück zu ändern.

Das ist auch so was: sasldblistusers2 und saslpasswd finden die Datei! Und wenn ich sie umbenenne, erstellt saslpasswd eine neue! (genau dort, wo sie hingehört)

Hier nochmal die berichtigten Dateirechte und die sasldblistusers2:

root@ubuntu-server:/etc# ls -l sasldb2
-rw-rw---- 1 root sasl 12288 2006-11-22 14:11 sasldb2
root@ubuntu-server:/etc# sasldblistusers2
test@ubuntu-server.localdomain: userPassword
root@ubuntu-server:/etc#

Danke nochmals!!

Gruß, bluba!

bluba

(Themenstarter)

Anmeldungsdatum:
7. Mai 2006

Beiträge: 4

Nach totaler verzweiflung, weil's immernoch nicht ging, habe ich auf saslauthd mit pam umgestellt und dann gings!

schöne anleitung unter: http://www.howtoforge.com/perfect_setup_ubuntu_6.10_p5

Trotzdem aber nochmal danke!

Antworten |