Problem mit SMTP Versand [gelöst]

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
native
Posts: 119
Joined: 2003-11-18 10:38
 

Problem mit SMTP Versand [gelöst]

Post by native »

Ausgehend von diesem Tutorial habe ich einen Postfix (+Dovecot,+Amavis) Mailserver aufgesetzt. Nur der SMTP Versand klappt nicht. Versuche ich per Emailclient eine Email zu verschicken, so steht diese Fehlermeldung in /var/log/mail.log :

Code: Select all

Aug 3 11:38:45 myHost postfix/smtpd[9503]: connect from 12345.dip0.t-ipconnect.de[12.34.56.78]
Aug 3 11:38:48 myHost dovecot: auth-worker(default): mysql: Connected to 127.0.0.1 (mailserver)
Aug 3 11:38:50 myHost postfix/smtpd[9503]: warning: 12345.dip0.t-ipconnect.de[12.34.56.78]: SASL PLAIN authentication failed:
Aug 3 11:38:52 myHost postfix/smtpd[9503]: warning: 12345.dip0.t-ipconnect.de[12.34.56.78]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Aug 3 11:39:00 myHost postfix/smtpd[9503]: disconnect from 12345.dip0.t-ipconnect.de[12.34.56.78]
Email abrufen per POP3 mit denselben Zugangsdaten funktioniert. "UGFzc3dvcmQ6" ist weder das Passwort, noch ein Hash davon.
Postfix ist mit folgenden Parametern konfiguriert:

Code: Select all

smtpd_use_tls = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_tls_auth_only = yes
Hat mir jmd einwn Tipp, wo der Fehler sein könnte?
Last edited by native on 2010-08-07 23:46, edited 1 time in total.
dotme
Posts: 150
Joined: 2004-12-15 16:48
 

Re: Problem mit SMTP Versand

Post by dotme »

http://www.postfix.org/SASL_README.html ... vecot_comm

Prüfe mal ob die client-socket entsprechend in dovecot konfiguriert ist und ob die Datei- und Pfadrechte Postfix darauf Zugriff erlauben.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

sieht für mich ok aus:

Code: Select all

socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0600
      user = vmail
    }
    client {
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix
    }
  }
Dateirechte sehen ebenfalls ok aus. Andere Idee?
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: Problem mit SMTP Versand

Post by daemotron »

native wrote:"UGFzc3dvcmQ6" ist weder das Passwort, noch ein Hash davon.
Nein, das ist noch was viel besseres:

Code: Select all

echo "UGFzc3dvcmQ6" | base64 -d
lüftet das Geheimnis...

P. S. poste mal bitte die komplette auth-Sektion aus der Dovecot-Konfiguration.
Last edited by daemotron on 2010-08-03 20:52, edited 1 time in total.
“Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.” — Terry Pratchett, Thief of Time
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

dotme
Posts: 150
Joined: 2004-12-15 16:48
 

Re: Problem mit SMTP Versand

Post by dotme »

Ansonsten verlangst Du ja per

Code: Select all

smtpd_tls_auth_only = yes
eine verschlüsselte Verbindungg bei Verwendung von SMTP-AUTH. Bist Du sicher das Dein Mailclient (?) auf TLS umschaltet. Wenn Du als Loglevel mindestens

Code: Select all

smtpd_tls_loglevel = 1
gesetzt hast, hätte davon etwas im Log gestanden.

BTW unter http://qmail.jms1.net/test-auth.shtml ist nett beschrieben wie Du die Authentifizierung händisch testen kannst - auch mit STARTTLS per "openssl s_client".
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

Ich habe das log level gesetzt, und laut log files wird eine TLS Verbindung gestartet:

Code: Select all

 setting up TLS connection from p12345.dip0.t-ipconnect.de[12.34.56.78]
Anonymous TLS connection established from p12345.dip0.t-ipconnect.de[12.34.56.78]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Danach derselbe Fehler wie zuvor.

Verbinde ich mich vom Server direkt per Telnet/SMTP und authentifiziere ich mich dort, funktioniert es fehlerfrei.

Noch eine Idee?
dotme
Posts: 150
Joined: 2004-12-15 16:48
 

Re: Problem mit SMTP Versand

Post by dotme »

Naja, dann klingt es doch nach einem Client-Problem? Aber Du willst ja nicht verraten welchen Mailclient Du verwendest. Ansonsten würde ich mal TLS deaktivieren und tcpdump mitlaufen lassen.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

sorry, die Frage nach dem Client habe ich überlesen: Thunderbird (bzw. Icedove)

TLS habe ich mal deaktiviert im Client, gleicher Fehler und gleicher Eintrag in den Logfiles.

hier der tcpdump
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Problem mit SMTP Versand

Post by Joe User »

Schuss ins Blaue:
#
# static settings generated from template <doc/wiki/UserDatabase.Static.txt>
#
userdb static {
# Template for the fields. Can return anything a userdb could normally
# return. For example:
#
# args = uid=500 gid=500 home=/var/mail/%u
#
# If you use deliver, it needs to look up users only from the userdb. This
# of course doesn't work with static because there is no list of users.
# Normally static userdb handles this by doing a passdb lookup. This works
# with most passdbs, with PAM being the most notable exception. If you do
# the user verification another way, you can add allow_all_users=yes to
# the args in which case the passdb lookup is skipped.
#
args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
}
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

was denkst Du stimmt daran nicht? Die Zeile zeigt Dovecot nur an, wo die Mailboxen liegen.
dotme
Posts: 150
Joined: 2004-12-15 16:48
 

Re: Problem mit SMTP Versand

Post by dotme »

native wrote:hier der tcpdump
:sad: Ich hätte da eher an ein `tcpdump -s 0 -w smtp-auth.pcap tcp port 25` gedacht und Du hättest Dir den SMTP-Dialog im Wireshark ansehen können.

Thunderbird kannst Du auch so zum Logging überreden.
Last edited by dotme on 2010-08-04 15:22, edited 1 time in total.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Problem mit SMTP Versand

Post by Joe User »

native wrote:was denkst Du stimmt daran nicht? Die Zeile zeigt Dovecot nur an, wo die Mailboxen liegen.
Lies mal den Kommentar, insbesondere den letzten Satz.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

Code: Select all

If you do the user verification another way, you can add allow_all_users=yes to the args in which case the passdb lookup is skipped.
Tue ich ja; die Verifizierung passiert über die MySQL DB:

Code: Select all

#
# SQL database <doc/wiki/AuthDatabase.SQL.txt>
#
  passdb sql {
#
    # Path for SQL configuration file
#
    args = /etc/dovecot/dovecot-sql.conf
#
  }
Von daher sollte das so schon stimmen. Oder verstehe ich das falsch?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Problem mit SMTP Versand

Post by Joe User »

Ich markiere mal das Wichtigste:
If you do the user verification another way, you can add allow_all_users=yes to the args in which case the passdb lookup is skipped.
Der MySQL-Lookup läuft über passdb...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

Guter Geedanke. Ich habe den Parameter auf "no" gesetzt, später ganz entfernt, und jeweils Dovecot neu gestartet -- gleiches Problem, gleiche Fehlermeldung in den Logfies.
User avatar
rudelgurke
Posts: 409
Joined: 2008-03-12 05:36
 

Re: Problem mit SMTP Versand

Post by rudelgurke »

Und zum Test einen anderen Mailclient probiert ? Wenn - wie geschrieben - es per telnet funktionieren soll ;)
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

ein Kollege hat es von seinem Rechner versucht, gleiches Problem. Folgende Fehlermeldung gibt sein Client (Thunderbird unter WIN 7) aus:

Code: Select all

Senden der Nachricht fehlgeschlagen.
Die Nachricht konnte nicht gesendet werden, weil der Verbindungsaufbau mit dem SMTP-Server 85.214.140.95 fehlgeschlagen ist. Der Server ist entweder nicht verfügbar oder lehnt SMTP-Verbindungen ab. Bitte kontrollieren Sie die SMTP-Server-Einstellungen und versuchen Sie es nochmals oder kontaktieren Sie Ihren Netzwerkadministrator.

Senden der Nachricht fehlgeschlagen.
Fehler beim Senden der Nachricht: Authentifizierung am SMTP-Server 85.214.140.95 ist nicht möglich. Der Server unterstützt keine kompatiblen sicheren Authentifizierungsmechanismen, aber Sie haben sichere Authentifikation gewählt. Versuchen Sie, sichere Authentifikation abzuschalten oder kontaktieren Sie Ihren Service-Provider.
mail.log sagt mir aber:

Code: Select all

Aug  7 17:09:47 myHost postfix/smtpd[9977]: setting up TLS connection from HSI-KBW-1234.hsi6.kabel-badenwuerttemberg.de[IP]
Aug  7 17:09:47 myHost postfix/smtpd[9977]: Anonymous TLS connection established from HSI-KBW-1234.hsi6.kabel-badenwuerttemberg.de[IP]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Aug  7 17:09:47 myHost postfix/smtpd[9977]: disconnect from HSI-KBW-1234.hsi6.kabel-badenwuerttemberg.de[IP]
Der Verweis eines fehlgeschlagenen Logins taucht hier nicht auf.

Noch weitere Ideen?
Last edited by native on 2010-08-07 17:30, edited 1 time in total.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Problem mit SMTP Versand

Post by Joe User »

Thunderbird (habe nur die US-Version hier):
-> Account Settings
-> Account
-> Server Settings
-> Port: 993
-> Connection security: SSL/TLS
-> [ ] Use secure authentication
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: Problem mit SMTP Versand

Post by daemotron »

Der Client, mit dem Du getestet hast, ist broken oder falsch konfiguriert - siehe mein Posting oben. Dort wurde anstelle eines Kennworts noch mal ein "Password:" übermittelt...
“Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.” — Terry Pratchett, Thief of Time
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

Joe User wrote: -> Port: 993
Das ist der Imaps Port, es geht aber um SMTP. SMTP hört laut nmap auf Port 25 (wie es sein soll).
daemotron wrote:Der Client, mit dem Du getestet hast, ist broken oder falsch konfiguriert - siehe mein Posting oben. Dort wurde anstelle eines Kennworts noch mal ein "Password:" übermittelt...
Ich habe mir die Einstellungen 20 Mal angesehen, sehe aber schlicht keinen Fehler:

Accounts > Outgoing Server (SMTP) >
Description: testing smtp
Server Name: myHost
Port: 25
Security and Authentication:
use name and password (tick)
user name: email@myHost.com
TLS (tick)

Ich habe auch nicht den Eindruck, dass sich hier soviel falsch machen lässt. Wo könnte denn noch ein Fehler liegen?

Der Client selbst ist sicherlich nicht broken, da ich fast gleiche Einstellungen bei 2 anderen SMTP Servern verwende, die stressfrei funktionieren.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Problem mit SMTP Versand

Post by Joe User »

Oops, klar SMTP Server Settings:
Port: 25
Connection security: STARTTLS
Authentication method: Normal password
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

Connection Security und Authentication method gibt es bei mir nicht (Version 2.0), nur die Settings, die ich oben bereits gepostet habe.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11185
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Problem mit SMTP Versand

Post by Joe User »

Du solltest dringend updaten.

Thunderbird/3.1.1
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
native
Posts: 119
Joined: 2003-11-18 10:38
 

Re: Problem mit SMTP Versand

Post by native »

Ich habe in Dovecot noch "auth_verbose=yes" gesetzt, das gibt mir in den Logfiles diese Einträge:

Code: Select all

Aug  7 23:15:13 host dovecot: Killed with signal 15
Aug  7 23:15:13 host dovecot: Dovecot v1.0.15 starting up
Aug  7 23:15:13 host dovecot: auth-worker(default): mysql: Connected to 127.0.0.1 (mailserver)
Aug  7 23:15:21 host postfix/smtpd[26250]: connect from p1234.dip0.t-ipconnect.de[12.34.56.78]
Aug  7 23:15:22 host postfix/smtpd[26250]: setting up TLS connection from p1234.dip0.t-ipconnect.de[12.34.56.78]
Aug  7 23:15:22 host postfix/smtpd[26250]: Anonymous TLS connection established from p1234.dip0.t-ipconnect.de[12.34.56.78]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Aug  7 23:15:23 host dovecot: auth-worker(default): sql(email@domain.com): Password mismatch
Aug  7 23:15:25 host postfix/smtpd[26250]: warning: p1234.dip0.t-ipconnect.de[12.34.56.78]: SASL PLAIN authentication failed: 
Aug  7 23:15:25 host dovecot: auth-worker(default): sql(email@domain.com): Password mismatch
Aug  7 23:15:27 host postfix/smtpd[26250]: warning: p1234.dip0.t-ipconnect.de[12.34.56.78]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
Aug  7 23:15:28 host postfix/smtpd[26250]: disconnect from p1234.dip0.t-ipconnect.de[12.34.56.78]
Mein Kollege hat die neue Version verwendet, gleiches Problem - daher liegt es wohl nicht an der Clientversion. Aber offensichtlich kommt das Passwort nicht am Mailserver an. Eine Erklärung dafür?