Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix + smtp_auth mit sasl
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Poppenpopper
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2003
Posts: 78
Location: Böblingen

PostPosted: Tue Feb 17, 2004 1:09 pm    Post subject: postfix + smtp_auth mit sasl Reply with quote

Hallo Leute,

für meinen Rechner auf dem Postfix läuft habe ich nun, um auch externen Nutzern das Mailversenden zu erlauben, SMTP-Authenfizierung einrichten wollen.

Gesagt getan, ich habe

Code:
# Enable SMTP AUTH with SASL
smtpd_sasl_auth_enable = yes
                                                                                 
# optional: no anonymous login
smtpd_sasl_security_options = noanonymous
                                                                                 
smtpd_sasl_local_domain = $myhostname
                                                                                 
# workaround for some old clients
broken_sasl_auth_clients = yes


an meine /etc/postfix/main.cf angehängt.

In der /etc/sasl2/smtpd.conf steht nur:

Code:
pwcheck_method:saslauthd


und vom saslauthd werden laut ausgabe mit saslauthd -v diese Mechanismen zur Authentifizierung unterstützt:

Code:
authentication mechanisms: getpwent pam rimap shadow


Ich möchte "nur", dass die entsprechenden Nutzer gegen die /etc/passwd geprüft werden und falls erfolgreich, senden dürfen.

Wenn nun ein Versendevorgang per Email-Client gestartet wird, erhalte ich in der /var/log/messages nur folgende Fehlermeldungen:

Code:
Feb 17 13:06:25 hostname postfix/smtpd[20729]: warning: SASL authentication failure: Password verification failed
Feb 17 13:06:25 hostname postfix/smtpd[20729]: warning: p508AA575.dip.t-dialin.net[80.138.165.117]: SASL PLAIN authentication failed


Allerdings sollte das Passwort (müsste ja das normale Nutzerpasswort des Users sein) stimmen. Hat jemand eine Anregung für mich, wie ich weiter vorgehen könnte?

Grüße aus Böblingen
Lars
Back to top
View user's profile Send private message
ruth
Retired Dev
Retired Dev


Joined: 07 Sep 2003
Posts: 640
Location: M / AN / BY / GER

PostPosted: Tue Feb 17, 2004 7:41 pm    Post subject: Reply with quote

hi,
endlich mal wieder eine interessante frage - danke dir dafür... ;-)
also:
versuch mal folgendes:
main.cf
Code:

# sasl
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated
      permit_mynetworks
      reject_unauth_destination

in /etc/sasl2/smtpd.conf:
Code:

pwcheck_method: saslauthd
mech_list: plain login

dass du den saslauthd gestartet haben musst ist klar, oder?
kommando:
Code:

/etc/init.d/saslauthd start


solltest du damit nicht weiterkommen / noch fragen haben, bitteschön.. ;-)
ach ja, eine einfache möglichkeit zu testen, ob dein postfix zumindest ansatzweise richtig konfiguriert ist bietet ein einfaches telnet auf deinen SMPT-Port; sollte so in etwa aussehen:
Code:

S: 220 mail.example.com ESMTP Postfix
C: EHLO example.com
S: 250-mail.example.com
S: 250-PIPELINING
S: 250-SIZE 10240000
S: 250-VRFY
S: 250-ETRN
S: 250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5 GSSAPI
S: 250-AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5 GSSAPI
S: 250-XVERP
S: 250 8BITMIME
C: quit
S: 221 Bye


auf die gleiche art und weise kannst du die fkt prüfen:
Code:

[root@example.com]# printf 'username\0username\0password' | mmencode

oder
Code:

[root@example.com]# perl -MMIME::Base64 -e 'print encode_base64("username\0username\0password");'

produziert ein BASE64 encodedes credential;
danach telnet, usw - folgendes sollte ersscheinen:
Code:

S: 220 mail.example.com ESMTP Postfix (1.1.7)
C: EHLO example.com
S: 250-mail.example.com
S: 250-PIPELINING
S: 250-SIZE 10240000
S: 250-VRFY
S: 250-ETRN
S: 250-AUTH DIGEST-MD5 CRAM-MD5 GSSAPI PLAIN LOGIN
S: 250-AUTH=DIGEST-MD5 CRAM-MD5 GSSAPI PLAIN LOGIN
S: 250-XVERP
S: 250 8BITMIME
C: AUTH PLAIN dGVzdAB0ZXN0AHRlc3RwYXNz
S: 235 Authentication successful
C: QUIT
S: 221 Bye

danach testen mit clients...


herzlichen gruss
rootshell
_________________
"The compiler has tried twice to abort and cannot do so; therefore, compilation will now terminate."
-- IBM PL/I (F) error manual
Back to top
View user's profile Send private message
Poppenpopper
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2003
Posts: 78
Location: Böblingen

PostPosted: Tue Feb 17, 2004 8:06 pm    Post subject: Reply with quote

Hi rootshell,

danke für die Antwort. Die Config hat nachdem ich noch ein paar Sachen geändert hatte gestimmt. Jetzt bin ich aber gerade mal auf die Idee zu kommen zu checken, ob die /etc/sasl2/smtpd.conf auch richtig abgearbeitet wird... tja die lag im falschen verzeichnis... da kann man versuchen soviel einzustellen, wie man will ;-)

Die sollte eigentlich in /usr/lib/sasl2 liegen, naja im symlink hat abhilfe geschafft. :-)

Jetzt habe ich aber immer noch das Problem, dass der saslauthd zwar bei systemstart gestartet wird, sich aber nicht stoppen lässt... ist das bei Dir auch so?

Gruß
Lars
Back to top
View user's profile Send private message
ruth
Retired Dev
Retired Dev


Joined: 07 Sep 2003
Posts: 640
Location: M / AN / BY / GER

PostPosted: Wed Feb 18, 2004 12:09 pm    Post subject: Reply with quote

hi,
nein, bei mir lässt er sich starten / stoppen wie er soll...
hmmm, die verwendete config-datei lässt sich (allgemein) bei dämonen
entweder an der commandline ändern oder zur kompilierzeit einstellen...
bei mir isses halt die /etc/sasl2/smtpd.conf
[bei dir _mag_ das anders sein... ;-)]

gruss
rootshell
_________________
"The compiler has tried twice to abort and cannot do so; therefore, compilation will now terminate."
-- IBM PL/I (F) error manual
Back to top
View user's profile Send private message
wkonline
n00b
n00b


Joined: 06 Mar 2004
Posts: 8
Location: Hamburg

PostPosted: Fri Mar 19, 2004 9:32 pm    Post subject: Reply with quote

Hi,

um diesen Thread nochmal aufzufrischen ;)

Ich habe auch ein Problem mit Postfix und smtp-auth.
Ich habe diverse Anleitungen durchforstet und diese ausprobiert. Nichts hat geklappt.
Nun bin ich auf dieses Thread gestoßen, habe die Einstellungen wie beschrieben vorgenommen, aber es tut sich leider immer noch nichts...

Im einzelnen schlägt die Authentifizierung fehl und im Log ist folgender Fehler zu sehen:

Code:
Mar 19 22:27:30 london postfix/smtpd[10819]: connect from pid.local.name[192.168.1.1]
Mar 19 22:27:30 london postfix/smtpd[10819]: 384DA1607A6: client=pid.local.name[192.168.1.1]
Mar 19 22:27:30 london postfix/smtpd[10819]: 384DA1607A6: reject: RCPT from pid.local.name[192.168.1.1]: 554 <pid@local.name>: Relay access denied; from=<sshuser@local2.name> to=<pid@local.name> proto=ESMTP helo=<localhost>
Mar 19 22:27:31 london postfix/smtpd[10819]: disconnect from pid.local.name[192.168.1.1]


Und was mich noch wundert: bei einer Telnetverbindung (wie oben beschrieben) erhalte ich bei den 2 Auth-Zeilen folgendes:

Code:
250-AUTH NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
250-AUTH=NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5


Im Beispiel oben stand aber noch etwas hinter dem CRAM-MD5. Ist hier vielleicht der Fehler?

Vielleicht weiss ja jemand eine Antwort!

Gruß,

wkonline
Back to top
View user's profile Send private message
wkonline
n00b
n00b


Joined: 06 Mar 2004
Posts: 8
Location: Hamburg

PostPosted: Sat Mar 20, 2004 7:59 pm    Post subject: Reply with quote

Hi,

habe da noch eine Sache in den Logfiles gefunden:

Code:
Mar 20 20:51:53 london postfix/smtpd[9300]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Mar 20 20:51:53 london postfix/smtpd[9300]: warning: SASL authentication failure: Password verification failed


Also meiner Meinung nach ist saslauthd gestartet. Nur leider kann Postfix nicht mit ihm kommunizieren.

Hat jemand soetwas schonmal gehabt?

Gruß,

wkonline
Back to top
View user's profile Send private message
lolli78
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 162
Location: Europe

PostPosted: Sat Mar 20, 2004 9:39 pm    Post subject: Reply with quote

hallo,
vielleicht hilft allen, die englisch können, folgendes weiter: https://forums.gentoo.org/viewtopic.php?t=56633

lorenz.
_________________
frag' doch deinadmin.de
Back to top
View user's profile Send private message
Poppenpopper
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2003
Posts: 78
Location: Böblingen

PostPosted: Sat Mar 20, 2004 9:39 pm    Post subject: Reply with quote

ist vielleicht der pfad zu irgendeiner config datei falsch angegeben?

gruß
Lars
Back to top
View user's profile Send private message
wkonline
n00b
n00b


Joined: 06 Mar 2004
Posts: 8
Location: Hamburg

PostPosted: Sat Mar 20, 2004 9:46 pm    Post subject: Reply with quote

Hi,

ich habe meinen Fehler gefunden. Ich habe saslauthdb mit einem völlig schwachsinnigen Parameter gestartet. Mit einem
Code:
/usr/bin/saslauthd -a pam

geht es wunderbar :D

Postfix läuft nun also einfandfrei.
Hab zwar noch ein paar Fragen zum Thema virtuelle Domains, aber ich glaube, das ist in diesem Thread etwas OT. Ausserdem muss google erstmal herhalten ;)

Gruß,

wkonline
Back to top
View user's profile Send private message
Poppenpopper
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2003
Posts: 78
Location: Böblingen

PostPosted: Sat Mar 20, 2004 9:48 pm    Post subject: Reply with quote

da gibts ja dann auch folgendes Howto für:

http://www.gentoo.de/doc/de/virt-mail-howto.xml

Grüße aus Böblingen
Lars
Back to top
View user's profile Send private message
wkonline
n00b
n00b


Joined: 06 Mar 2004
Posts: 8
Location: Hamburg

PostPosted: Sat Mar 20, 2004 10:01 pm    Post subject: Reply with quote

Hmmm,

nun kann ich zwar über Client mittels SMTP-Auth versenden, aber ich kann lokal (Kommandozeile, Webmail, etc.) nichts mehr versenden, da meldet er nun immer ein Relaying Denied.

Woran kann das denn nun schon wieder liegen?

Gruß,

Stephan
Back to top
View user's profile Send private message
Poppenpopper
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2003
Posts: 78
Location: Böblingen

PostPosted: Fri Apr 02, 2004 5:52 pm    Post subject: Reply with quote

wie sieht deine main.cf aus?

Gruß
Lars
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum