Postfix SASL klappt nicht mit Dovecot

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Hallo zusammen.

Ich habe in den letzten Tagen einen Mailserver mit postfix und dovecot aufgesetzt, und inzwischen funktioniert alles bis auf die SASL Authentifizierung vom SMTP Server mittels dovecot. Und ich weiß nicht, wieso.

Hier die relevanten config Ausschnitte:

dovecot

Code: Select all

# Authentifizierungs-Info aus Datenbank
auth default {
  mechanisms = plain login
 
  passdb sql {
    args = /etc/dovecot/dovecot-sql.conf
  }
 
  # steigert Performance mit Datenbank
  userdb prefetch {
  }
  userdb sql {
    args = /etc/dovecot/dovecot-sql.conf
  }
 
  user = nobody
 
  socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0660
 
      user = postfix
      group = mail
    }
    client {
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix
    }
  }
}
postfix

Code: Select all

# SASL
smtpd_sasl_type = dovecot
smtpd_sasl_security_options = noanonymous
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
#smtpd_sasl_exceptions_networks = $mynetworks
#smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
Dass dovecot funktioniert weiß ich, weil Imap inkl. SSL und Authentifizierung klappt. Auch das Entgegennehmen von Mails klappt inzwischen sogar von gmail. Nur eben die Authentifizierung am SMTP Server nicht. bei "telnet localhost 25" und einem EHLO wird AUTH nicht als möglicher Befehl erwähnt.

Was kann ich tun, um mehr Informationen zur Ursache zu bekommen? In den Log Files finde ich gar nichts...

Danke schonmal,
Jan Oliver Oelerich
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

dovecot.conf:

Code: Select all

auth default {
  mechanisms = plain login
  passdb sql {
    args = /etc/dovecot/dovecot-sql.conf
  }
  userdb sql {
    args = /etc/dovecot/dovecot-sql.conf
  }
  user = root
  socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0600
    }
    client {
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix
    }
  }
}
main.cf:

Code: Select all

broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
Mehr ist normalerweise nicht nötig.
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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Hallo, Danke für die Antwort. Ich habs mal genau so übernommen, es geht aber noch nicht.

Hier nochmal etwas mehr aus meiner postfix config datei:

Code: Select all

# SASL
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination
    permit
im telnet test taucht AUTH immer noch nicht auf.

Grüße
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Distro? Postfix-Version?

Code: Select all

postconf -n
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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Distro: debian 6
postconf -d | grep mail_version => 2.7.1

Code: Select all

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
anvil_rate_time_unit = 60s
anvil_status_update_time = 600s
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 2d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_database_type = btree
inet_protocols = all
mailbox_size_limit = 0
maximal_queue_lifetime = 3d
message_size_limit = 26214400
mydestination = MEINHOST, localhost.localdomain, , localhost
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_connection_count_limit = 25
smtpd_client_connection_rate_limit = 60
smtpd_client_message_rate_limit = 1000
smtpd_client_recipient_rate_limit = 1000
smtpd_recipient_restrictions = permit_mynetworks    permit_sasl_authenticated    reject_unauth_destination    permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/MEINCERT
smtpd_tls_key_file = /etc/ssl/private/MEINKEY
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = proxy:mysql:$config_directory/maps/mysql_virtual_alias_maps.cf,    proxy:mysql:$config_directory/maps/mysql_virtual_alias_domains_maps.cf
virtual_gid_maps = static:8
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:$config_directory/maps/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:$config_directory/maps/mysql_virtual_mailbox_maps.cf,    proxy:mysql:$config_directory/maps/mysql_virtual_alias_domain_mailbox_maps.cf,    proxy:mysql:$config_directory/maps/mysql_virtual_alias_domain_catchall_maps.cf
virtual_minimum_uid = 150
virtual_uid_maps = static:150

Last edited by janoliver on 2011-04-07 12:34, edited 2 times in total.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Die Postfix-Konfiguration kannst Du (abgesehen von den Pfaden) nahezu 1zu1 von http://www.rootservice.org/howtos/freeb ... ystem.html übernehmen. Für Dovecot 2.x findest dort ebenfalls eine anzupassende Config und für Dovecot 1.2.x unter http://www.rootservice.org/howtos/gento ... ystem.html wobei alle drei Configs beim MySQL-Support auf das Zusammenspiel mit PostfixAdmin ausgelegt sind. Gegebenenfalls musst Du also die MySQL-Optionen überspringen/anpassen.
Bitte vorher den noch etwas spärlichen Text dazu lesen, nicht blind abtippen ;)
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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Danke für den Link, ich werds mir mal ansehen. Ich fände es aber natürlich schöner, den Fehler in meiner Konfiguration zu finden und nicht eine ganz neue zu übernehmen.

Ich vergleiche die beiden einfach mal akribisch.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Ist Dein Postfix überhaupt gegen Dovecots SASL gelinkt?
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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Ich denke schon... postconf -a :
cyrus
dovecot

Installiert hab ichs aber nur mit
apt-get install postfix postfix-mysql
Last edited by janoliver on 2011-04-07 13:24, edited 2 times in total.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Dann sollte es passen.
Hoffentlich helfen Dir die Links weiter und Du/wir finden den Fehler.
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
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

janoliver wrote:bei "telnet localhost 25" und einem EHLO wird AUTH nicht als möglicher Befehl erwähnt.
Das ist auch Richtig so, das "AUTH mech ..." musst Du wie das EHLO senden.
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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

AUTH
503 5.5.1 Error: authentication not enabled
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Füge testweise mal folgende Zeile zusätzlich in die main.cf ein:

Code: Select all

smtpd_sasl2_auth_enable = 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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

leider nicht. Ich werd noch verrückt, google seit Stunden nach dem Mist. :(
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Ich habs.

smtpd_tls_auth_only = yes

war es. Setze ich das auf = no, funktioniert es.
TLS funktioniert schon noch, oder? Lediglich wird es nicht erzwungen, richtig?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Ja, funktioniert noch.
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.
janoliver
Posts: 10
Joined: 2011-04-07 11:16
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by janoliver »

Weiter gehts. Beim Versenden von Mails erhalte ich folgendes:

Code: Select all

Out: 220 www.oelerich.org ESMTP Postfix (Debian/GNU)
 In:  EHLO **
 Out: 250-**
 Out: 250-PIPELINING
 Out: 250-SIZE 26214400
 Out: 250-VRFY
 Out: 250-ETRN
 Out: 250-STARTTLS
 Out: 250-ENHANCEDSTATUSCODES
 Out: 250-8BITMIME
 Out: 250 DSN
 In:  STARTTLS
 Out: 220 2.0.0 Ready to start TLS
 In:  EHLO **
 Out: 250-**
 Out: 250-PIPELINING
 Out: 250-SIZE 26214400
 Out: 250-VRFY
 Out: 250-ETRN
 Out: 250-AUTH PLAIN LOGIN
 Out: 250-ENHANCEDSTATUSCODES
 Out: 250-8BITMIME
 Out: 250 DSN
 In:  AUTH PLAIN **
 Out: 235 2.7.0 Authentication successful
 In:  MAIL FROM:<**> SIZE=529
 Out: 250 2.1.0 Ok
 In:  RCPT TO:<**>
 Out: 451 4.3.0 Error: queue file write error
 In:  QUIT
 Out: 221 2.0.0 Bye
Es ist kein Anhang, nichts. In den mail.log, mail.err usw. findet sich absolut keine Fehlermeldung. Woran kann das nun wieder liegen?

/e: Auch das ist so halb gelöst... Mit STARTTLS funktioniert das Senden, aber nicht mit SSL...
Last edited by janoliver on 2011-04-07 19:40, edited 1 time in total.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11186
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix SASL klappt nicht mit Dovecot

Post by Joe User »

Zu dem "queue file write error" muss in den Logs eigentlich etwas auftauchen. Vermutlich stimmen die Rechte nicht oder /var hat keine Luft mehr.
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.