SMTP und Postfix

Igor1312

New Member
Hi,

ich bekomme beim Senden mit SMTP-Authentifizierung Fehler.
Ich habe Postfix mit Webmin konfiguriert und den Standard übernommen.

Das ist die main.cf:
Code:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
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:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = india915.server4you.de, istneu.de, localhost.de, localhost
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a $EXTENSION
mailbox_size_limit = 0
recipient_delimiter = +
virtual_alias_maps = hash:/etc/postfix/virtual
broken_sasl_auth_clients = yes
smtpd_delay_reject = no
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated

Im mail.err steht
Code:
Jan  5 11:51:45 istneu postfix/smtpd[7381]: fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit

Wenn ich reject_unauth_destination mit aufnehme, steht im mail.err
Code:
Jan  5 11:54:48 istneu postfix/smtpd[7783]: fatal: no SASL authentication mechanisms

Bitte Hilfe! Was muss ich tun? Die Hilfe zu Postfix und SASL-Auth (Postfix SASL Howto) ist für mich unverständlich.

Welche Informationen muss ich in diesem Beitrag nennen, damit geholfen werden kann?

Danke.

Tschö,
Igor
 
Hammer! Super Seite, danke für den Tipp!

Aber ... ;)
In die smtpd.conf soll rein:
Code:
saslauthd_path: /var/run/saslauthd/mux

Das Verzeichnis gibt es auf meinem System nicht :eek:

Daher funktioniert weiter unten in der Howto das hier nicht:
Code:
mv saslauthd/ /var/spool/postfix/var/run

und die Authentifizierung am Ende eben leider auch nicht.
Das kann aber jetzt doch nicht mehr so schwierig sein. Muss ich das Verzeichnis einfach nur anlegen? :confused:

Was anderes, wo wir schon mal dabei sind.
In einem Linux-Forum habe ich gelesen, das man bzgl. Spamabwehr folgende Zeile in die main.cf einbauen sollte:
Code:
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, reject_non_fqdn_hostname, reject_unknown_hostname

Damit wirft Postfix aber ein paar Fehlermeldungen ins mail.log, und zwar dieser Art:
Code:
Jan  5 22:55:27 istneu postfix/smtpd[16587]: NOQUEUE: reject: EHLO from p5481D2A9.dip.t-dialin.net[84.129.210.169]: 504 5.5.2 <nbmartina>: Helo command rejected: need fully-qualified hostname; proto=SMTP helo=<nbmartina>
Jan  5 23:04:34 istneu postfix/smtpd[16818]: NOQUEUE: reject: EHLO from p5481D2A9.dip.t-dialin.net[84.129.210.169]: 450 4.7.1 <nbmartina>: Helo command rejected: Host not found; proto=SMTP helo=<nbmartina>

"nbmartina" ist mein Laptop zu Hause. Wie soll ich dem denn einen FQDN geben, ohne Domäne?

Ich hab das daher mal auskommentiert. Wäre aber doch schön, wenn man mit solchen einfachen Mitteln tatsächlich Spam etwas eindämmen könnte :rolleyes:

Danke!

Tschö,
Igor
 
Code:
saslauthd_path: /var/run/saslauthd/mux
Das Verzeichnis gibt es auf meinem System nicht :eek:
Sollte angelegt werden sobald Du saslauthd einmal startest.

"nbmartina" ist mein Laptop zu Hause. Wie soll ich dem denn einen FQDN geben, ohne Domäne?
Ein FQDN wäre z.B. "nbmartina.local". Wie nutzt Du denn den Email-Server von Deinem Laptop aus?

huschi.
 
Die smtpd_helo_restrictions sind IMHO relativ nutzlos.

Für Spamabwehr sind policyd-weight, postgrey oder Spamassassin besser geeignet.

Authentifizierst du dich denn, wenn du Mails mit dem Mail-Client losschickst?
 
Last edited by a moderator:
Sollte angelegt werden sobald Du saslauthd einmal startest.

Wird es aber leider nicht.
Woran kann das liegen?

Das Verzeichnis gibt es in /var/spool/postfix/var/run/

Ein FQDN wäre z.B. "nbmartina.local". Wie nutzt Du denn den Email-Server von Deinem Laptop aus?

Ich verstehe die Frage nicht. Ich habe ihn als SMTP Server in Outlook eingetragen.

Tschö,
Igor
 
Last edited by a moderator:
Authentifizierst du dich denn, wenn du Mails mit dem Mail-Client losschickst?

Ja, klappt aber nicht. Outlook fragt immer wieder die Benutzerkennung ab.

Im mail.log steht dann:
Code:
Jan  6 11:38:52 istneu postfix/smtpd[2501]: connect from p5481D589.dip.t-dialin.net[84.129.213.137]
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: SASL authentication failure: no secret in database
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: p5481D589.dip.t-dialin.net[84.129.213.137]: SASL NTLM authentication failed: authentication failure
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: SASL authentication failure: realm changed: authentication aborted
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: p5481D589.dip.t-dialin.net[84.129.213.137]: SASL DIGEST-MD5 authentication failed: authentication failure
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Jan  6 11:38:53 istneu last message repeated 2 times
Jan  6 11:38:53 istneu postfix/smtpd[2501]: warning: p5481D589.dip.t-dialin.net[84.129.213.137]: SASL LOGIN authentication failed: authentication failure
Jan  6 11:38:53 istneu postfix/smtpd[2501]: lost connection after AUTH from p5481D589.dip.t-dialin.net[84.129.213.137]
Jan  6 11:38:53 istneu postfix/smtpd[2501]: disconnect from p5481D589.dip.t-dialin.net[84.129.213.137]

Ich habe probeweise den Pfad in der smtpd.conf mal auf /var/spool/postfix/var/run/saslauthd/mux gesetzt.

Tschö,
Igor
 
Last edited by a moderator:
Igor, es fehlen hier ein paar Daten.
Entweder Du bringst alle Config-Daten manuell hier ein, oder postest einfach mal die Ausgabe von saslfinger (siehe Probleme mit Postfix und SASL). Das sammelt alle nötigen SASL-Daten in einer kompakten Form ein.

huschi.
 
Hi Huschi,

testsaslauthd -f /var/spool/postfix/var/run/saslauthd/mux -u USER -p PASSWORT
funktioniert!

mit /var/run... nicht.

saslfinger schreibt eine für mich mal wieder überhaupt nicht nachvollziehbare Meldung ans Ende:

Code:
There is no smtpd.conf that defines what SASL should do for Postfix.
SMTP AUTH can't work!

Na dann, kein Wunder ;)
Die Datei ist aber in /etc/postfix/sasl vorhanden:
Code:
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
autotransition:true
saslauthd_path: /var/spool/postfix/var/run/saslauthd

Und nun noch die saslauthd iin /etc/default/
Code:
START=yes
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
Tschö,
Igor
 
Last edited by a moderator:
testsaslauthd -f /var/spool/postfix/var/run/saslauthd/mux -u USER -p PASSWORT
funktioniert!
Das ist schon mal gut.
Dann fehlt nur noch die Seite für Postfix.

saslfinger schreibt eine für mich mal wieder überhaupt nicht nachvollziehbare Meldung ans Ende:
Für mich wäre aber nicht das Ende interessant.

saslauthd_path: /var/spool/postfix/var/run/saslauthd
Wenn smtpd im chroot läuft muß es nur /var/run/saslauthd heißen.
Aber mehr kann ich nur sagen, wenn Du die Daten lieferst, die ich benötige.

huschi.
 
Hmm, das ist die ganze Ausgabe von saslfinger:
Code:
saslfinger - postfix Cyrus sasl configuration Di 6. Jan 12:36:09 CET 2009
version: 1.0
mode: server-side SMTP AUTH

-- basics --
Postfix: 2.3.8
System: Debian GNU/Linux 4.0 \n \l

-- smtpd is linked to --
	libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00002b9312fb5000)

-- active SMTP AUTH and TLS parameters for smtpd --
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous


-- listing of /usr/lib/sasl2 --
insgesamt 804
drwxr-xr-x  2 root root  4096 2009-01-05 22:44 .
drwxr-xr-x 38 root root 12288 2009-01-02 09:42 ..
-rw-r--r--  1 root root 18868 2006-12-13 22:52 libanonymous.a
-rw-r--r--  1 root root   855 2006-12-13 22:52 libanonymous.la
-rw-r--r--  1 root root 15792 2006-12-13 22:52 libanonymous.so
-rw-r--r--  1 root root 15792 2006-12-13 22:52 libanonymous.so.2
-rw-r--r--  1 root root 15792 2006-12-13 22:52 libanonymous.so.2.0.22
-rw-r--r--  1 root root 21754 2006-12-13 22:52 libcrammd5.a
-rw-r--r--  1 root root   841 2006-12-13 22:52 libcrammd5.la
-rw-r--r--  1 root root 19184 2006-12-13 22:52 libcrammd5.so
-rw-r--r--  1 root root 19184 2006-12-13 22:52 libcrammd5.so.2
-rw-r--r--  1 root root 19184 2006-12-13 22:52 libcrammd5.so.2.0.22
-rw-r--r--  1 root root 60216 2006-12-13 22:52 libdigestmd5.a
-rw-r--r--  1 root root   864 2006-12-13 22:52 libdigestmd5.la
-rw-r--r--  1 root root 48504 2006-12-13 22:52 libdigestmd5.so
-rw-r--r--  1 root root 48504 2006-12-13 22:52 libdigestmd5.so.2
-rw-r--r--  1 root root 48504 2006-12-13 22:52 libdigestmd5.so.2.0.22
-rw-r--r--  1 root root 19094 2006-12-13 22:52 liblogin.a
-rw-r--r--  1 root root   835 2006-12-13 22:52 liblogin.la
-rw-r--r--  1 root root 16424 2006-12-13 22:52 liblogin.so
-rw-r--r--  1 root root 16424 2006-12-13 22:52 liblogin.so.2
-rw-r--r--  1 root root 16424 2006-12-13 22:52 liblogin.so.2.0.22
-rw-r--r--  1 root root 38700 2006-12-13 22:52 libntlm.a
-rw-r--r--  1 root root   829 2006-12-13 22:52 libntlm.la
-rw-r--r--  1 root root 32520 2006-12-13 22:52 libntlm.so
-rw-r--r--  1 root root 32520 2006-12-13 22:52 libntlm.so.2
-rw-r--r--  1 root root 32520 2006-12-13 22:52 libntlm.so.2.0.22
-rw-r--r--  1 root root 19134 2006-12-13 22:52 libplain.a
-rw-r--r--  1 root root   835 2006-12-13 22:52 libplain.la
-rw-r--r--  1 root root 16392 2006-12-13 22:52 libplain.so
-rw-r--r--  1 root root 16392 2006-12-13 22:52 libplain.so.2
-rw-r--r--  1 root root 16392 2006-12-13 22:52 libplain.so.2.0.22
-rw-r--r--  1 root root 29100 2006-12-13 22:52 libsasldb.a
-rw-r--r--  1 root root   856 2006-12-13 22:52 libsasldb.la
-rw-r--r--  1 root root 21456 2006-12-13 22:52 libsasldb.so
-rw-r--r--  1 root root 21456 2006-12-13 22:52 libsasldb.so.2
-rw-r--r--  1 root root 21456 2006-12-13 22:52 libsasldb.so.2.0.22


There is no smtpd.conf that defines what SASL should do for Postfix.
SMTP AUTH can't work!

Was ist denn da so interessant bzw. hilfreich, wa ich vorhin wegließ?

Wenn smtpd im chroot läuft muß es nur /var/run/saslauthd heißen.

Ja, das las ich auch irgendwo. Nur, wie finde ich heraus, wie es läuft und stelle es entsprechend ein?

Welche Daten fehlen nun noch?
Die Postfix main.cf:
Code:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
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:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = india915.server4you.de, localhost.de, localhost
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a $EXTENSION
mailbox_size_limit = 0
recipient_delimiter = +
virtual_alias_maps = hash:/etc/postfix/virtual
broken_sasl_auth_clients = yes
smtpd_delay_reject = no

Die virtuellen Domains haben in der mydestination-Directive nichts zu suchen, richtig? Daher habe ich die hier mal unterschlagen ...

Tschö,
Igor
 
Wenn smtpd im chroot läuft muß es nur /var/run/saslauthd heißen.
In der master.cf steht es in der 5ten Spalte der smtp-Zeile. (Ein '-' bedeutet 'yes'.)

Sobald Du den richtigen Pfad in der /etc/postfix/sasl/smtpd.conf drin hast und saslauthd neu startest, wird das Verzeichnis angelegt. Danach folgst Du einfach wieder den weiteren Anweisungen im Howto.

huschi.
 
Also saslauthd starten und den Rest vom Howto ... klappt soweit :)
Das Verzeichnis /var/run/saslauthd ist also nun nur noch ein Symlink auf /var/spool/postfix/var/run/saslauthd.

Postfix läuft bei mir im chroot.
Welcher Pfad gehört denn nun in smtpd.conf ?
/var/run/saslauthd
oder
/var/run/saslauthd/mux ?

Ich nehme mal den ohne mux, steht auch so in der /etc/default/saslauthd drin.

Und restart ... schade, geht immer noch nicht. saslfinger liefert den selben Fehler, die smtpd.conf findet das System nicht.

:eek: Huch, die Datei heisst ja auch smptd.conf :mad:
Au weia...

Nun gut, Tippfehler korrigiert, jetzt geht es weiter.


Test:
Code:
Jan  6 16:53:53 istneu postfix/smtpd[2975]: warning: SASL authentication failure: cannot connect to saslauthd server: Permission denied
Jan  6 16:53:53 istneu postfix/smtpd[2975]: warning: p5481D589.dip.t-dialin.net[84.129.213.137]: SASL LOGIN authentication failed: generic failure

Wir haben immer noch ein Problem.

Hab mal /mux an den Pfad in der smtpd.conf angehängt. Und - voila, es läuft!
Ich krieg mich gar nicht mehr ein vor Glück :) :)

Muss es in der /etc/default/saslauthd nicht dann auch /mux heißen?

Wie dem auch sei, vielen vielen Dank!!!

Ach ne, einen hab ich noch.
Was muss ich machen, damit saslauthd beim Systemstart automatisch mit startet?

Tschö,
Igor
 
Last edited by a moderator:
Back
Top