Dovecot / Postfix / SASL: Verbindung zu /var/run/dovecot/auth-client fehlgeschlagen: Berechtigung verweigert

Dovecot / Postfix / SASL: Verbindung zu /var/run/dovecot/auth-client fehlgeschlagen: Berechtigung verweigert

Die Dovecot / Postfix-Konfiguration funktioniert auf meinem Server nicht richtig: Nach mehreren Überprüfungen verstehe ich, dass

  1. Imap-Dienste sind über lokale oder Desktop-Clients bedienbar
  2. Postfix hört zu und neue E-Mails werden in die Postfix-Warteschlange gestellt
  3. Die Übertragung von der Postfix-Warteschlange in Vmail-Ordner funktioniert nicht, während im Postfix-Protokoll dieser wiederkehrende Fehler „SASL: Verbindung zu /var/run/dovecot/auth-client fehlgeschlagen: Berechtigung verweigert“ erwähnt wird.

Hier ist meine Dovecot-Konfiguration.

# 2.2.15: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.9-xxxx-grs-ipv6-64 x86_64 Gentoo Base System release 2.2 ext4
auth_debug = yes
auth_mechanisms = plain login
auth_verbose = yes
auth_verbose_passwords = yes
base_dir = /var/run/dovecot/
debug_log_path = /var/log/dovecot-debug.log
first_valid_gid = 12
first_valid_uid = 150
info_log_path = /var/log/dovecot-info.log
last_valid_gid = 12
last_valid_uid = 150
log_path = /var/log/dovecot.log
mail_debug = yes
mail_gid = mail
mail_location = maildir:/home/vmail/%u
mail_uid = vmail
namespace inbox {
  inbox = yes
  location = maildir:/home/vmail/%u
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = INBOX.
  separator = .
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-userdb {
    group = mail
    mode = 0600
    user = vmail
  }
}
service lmtp {
  unix_listener lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
ssl_cert = </etc/ssl/postfix/server.pem
ssl_key = </etc/ssl/postfix/server.key
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
verbose_ssl = yes

Hier ist meine Postfix-Konfiguration.

alias_database = texthash:/etc/mail/aliases
alias_maps = texthash:/etc/mail/aliases
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 1
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont; echo where) | gdb $daemon_directory/$process_name $process_id 2>&1 >$config_directory/$process_name.$process_id.log & sleep 5
default_destination_concurrency_limit = 20
dovecot_destination_recipient_limit = 1
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.9.0/html
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps = $virtual_mailbox_maps
mail_owner = postfix
mail_spool_directory = /var/mail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost, 127.0.0.1
myhostname = ns3322776.ovh.net
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.9.0/readme
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix/${mail_version}
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,permit_inet_interfaces
smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_CAfile = /etc/ssl/postfix/server.pem
smtpd_tls_cert_file = /etc/ssl/postfix/server.crt
smtpd_tls_key_file = /etc/ssl/postfix/server.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = yes
unknown_local_recipient_reject_code = 550
virtual_gid_maps = static:150
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_minimum_uid = 150
virtual_transport = lmtp:unix:dovecot-lmtp
virtual_uid_maps = static:0

Hier ist das Protokoll

2015-02-26 11:25:22 - postfix/master - warning: process /usr/libexec/postfix/smtpd pid 22687 exit status 1
2015-02-26 11:25:22 - postfix/master - warning: process /usr/libexec/postfix/smtpd pid 22686 exit status 1
2015-02-26 11:25:22 - postfix/master - warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
2015-02-26 11:25:22 - postfix/master - warning: process /usr/libexec/postfix/smtpd pid 22685 exit status 1
2015-02-26 11:25:21 - postfix/smtpd - fatal: no SASL authentication mechanisms
2015-02-26 11:25:21 - postfix/smtpd - warning: SASL: Connect to /var/run/dovecot/auth-client failed: Permission denied
2015-02-26 11:25:21 - postfix/smtpd - connect from 39160.vs.webtropia.com[62.141.39.160]

Wenn jemand Tipps oder Ähnliches hat, lasst es mich bitte wissen. Das wird mir sehr helfen! Danke

Antwort1

Diesen Parameter definieren Sie in main.cf

smtpd_sasl_path = /var/run/dovecot/auth-client

Dies teilt Postfix mit, wo sich der Pfad zum Unix-Socket für die SASL-Verbindung befindet.

In der Dovecot-Konfiguration definieren Sie jedoch, dass sich der SASL-Socket in /var/spool/postfix/private/auth befindet

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  ...
}

Versuchen Sie, Postfix festzulegen smtpd_sasl_path = private/authund neu zu starten.

Antwort2

Ich hatte dieses Problem auch. Ich kann Ihre Protokolldateien nicht sehen, aber der Fehler trat folgendermaßen auf

Jan 18 16:54:47 xxxx0 postfix/smtpd[5819]: warning: SASL: Connect to /var/run/dovecot/auth-client failed: No such file or directory
Jan 18 16:54:47 xxxx0 postfix/smtpd[5819]: fatal: no SASL authentication mechanisms
Jan 18 16:54:48 xxxx0 postfix/master[5813]: warning: process /usr/lib/postfix/sbin/smtpd pid 5819 exit status 1
Jan 18 16:54:48 xxxx0 postfix/master[5813]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling

Dies ist schwer zu finden, da der Daemon beendet wird und es verwirrend ist, da der Socket /var/run/dovecot/auth-client existiert. Ich erinnerte mich, dass Postfix Chroot verwendet. Als ich die master.cf um nur ein Zeichen änderte

--- a/postfix/master.cf
+++ b/postfix/master.cf
@@ -9,7 +9,7 @@
 # service type  private unpriv  chroot  wakeup  maxproc command + args
 #               (yes)   (yes)   (no)    (never) (100)
 # ==========================================================================
-smtp      inet  n       -       y       -       -       smtpd
+smtp      inet  n       -       n       -       -       smtpd
 #smtp      inet  n       -       y       -       1       postscreen
 #smtpd     pass  -       -       y       -       -       smtpd
 #dnsblog   unix  -       -       y       -       0       dnsblog

Und startete die Daemons neu, keine Fehlermeldungen und der SMTP begann, Nachrichten zu empfangen

Jan 18 17:01:05 xxxx0 postfix/smtpd[6034]: connect from mail-lf1-f49.google.com[209.85.167.49]
Jan 18 17:01:06 xxxx0 postfix/smtpd[6034]: Anonymous TLS connection established from mail-lf1-f49.google.com[209.85.167.49]: TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
Jan 18 17:01:06 xxxx0 postfix/smtpd[6034]: 8852527CDA: client=mail-lf1-f49.google.com[209.85.167.49]
Jan 18 17:01:06 xxxx0 postfix/cleanup[6039]: 8852527CDA: message-id=<CAG7vz7oDTXmSfKOTM7YKqzVGvvXyEvtjsREaN4dXh+qJXN60BQ@mail.gmail.com>
Jan 18 17:01:06 xxxx0 postfix/qmgr[6013]: 8852527CDA: from=<[email protected]>, size=2730, nrcpt=1 (queue active)
Jan 18 17:01:06 xxxx0 postfix/virtual[6040]: 8852527CDA: to=<[email protected]>, relay=virtual, delay=0.03, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jan 18 17:01:06 xxxx0 postfix/qmgr[6013]: 8852527CDA: removed
Jan 18 17:01:06 xxxx0 postfix/smtpd[6034]: disconnect from mail-lf1-f49.google.com[209.85.167.49] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7

Mit mehr Aufwand könnte ich den Socket in das Chroot verlagern.

verwandte Informationen