Почтовый сервер: ошибка аутентификации SASL - Постфикс + Голубятня + Mysql

Я пытался настроить свой собственный почтовый сервер (постфикс, голубятня, mysql), и я могу соединиться через imaps/pop3s без любых проблем. Но каждый раз я пытаюсь соединиться с сервером SMTP (например, с Почтовым Приложением Apple) я получаю ошибку что, "Входя в систему сервера SMTP "domain.tld" отказавший..."

Я использовал этот веб-сайт для установки моего почтового сервера, и на другом моем сервере он работает.

В моем журнале ошибок говорится следующее:

Apr 19 04:30:26 s1 postfix/smtpd[2412]: Anonymous TLS connection established from c-xx-xxx-xxx-xx.hsd2.fl.comcast.net[xx.xxx.xxx.xx]: TLSv1 with cipher AES128-SHA (128/128 bits)
Apr 19 04:30:26 s1 postfix/smtpd[2412]: warning: SASL authentication problem: unknown password verifier 
Apr 19 04:30:26 s1 postfix/smtpd[2412]: warning: SASL authentication failure: Password verification failed
Apr 19 04:30:26 s1 postfix/smtpd[2412]: warning: c-xx-xxx-xxx-xx.hsd2.fl.comcast.net[xx.xxx.xxx.xx]: SASL PLAIN authentication failed: no mechanism available
Apr 19 04:30:26 s1 postfix/smtpd[2412]: disconnect from c-xx-xxx-xxx-xx.hsd2.fl.comcast.net[xx.xxx.xxx.xx]


вот содержание моего main.cf файла:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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

readme_directory = /usr/share/doc/postfix


# TLS parameters
#smtpd_tls_auth_only = no
smtpd_sasl_type = cyrus
smtp_tls_note_starttls_offer = yes


smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /var/ssl/public.crt
smtpd_tls_key_file = /var/ssl/domain_tld.key
smtpd_tls_CAfile = /var/ssl/intermediate.crt
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes

smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


smtpd_sasl_local_domain = 
smtpd_sasl_security_options=noanonymous
smtpd_delay_reject = yes


#anti-spam - added on march 27 2013 - martin

disable_vrfy_command = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,
     permit_sasl_authenticated,
     reject_non_fqdn_hostname,
     reject_invalid_hostname,
     permit



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

mydomain = domain.tld
myhostname = s1.domain.tld
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = domain.tld, s1.domain.tld localhost, localhost.localdomain
relayhost = 
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
message_size_limit = 30720000
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_recipient_restrictions =
   permit_sasl_authenticated,
   reject_unauth_destination,
   reject_invalid_hostname,
   reject_non_fqdn_hostname,
   reject_non_fqdn_sender,
   reject_non_fqdn_recipient,
   reject_unknown_sender_domain,
   reject_unknown_recipient_domain,
   permit_mynetworks,
   permit
#smtpd_error_sleep_time = 1s
#smtpd_soft_error_limit = 10
#smtpd_hard_error_limit = 20
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1



вот содержание моего master.cf файла:

# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
submission inet n       -       -       -       -       smtpd
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       -       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
    -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
dovecot   unix  -       n       n       -       -       pipe
    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}


здесь содержание моего/etc/postfix/sasl/smtpd.conf файла:

pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: mail_admin
sql_passwd: ******
sql_database: mail
sql_select: select password from users where email = '%u'


здесь содержание моего/etc/default/saslauthd файла:

START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"



telnet localhost 25 распечатывает:

# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 s1.domain.tld ESMTP Postfix (Debian/GNU)
ehlo localhost
250-s1.domain.tld
250-PIPELINING
250-SIZE 30720000
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN




я надеюсь, что у кого-то есть решение для моей проблемы.
В основном я хочу иметь рабочий почтовый сервер, который работает с ssl и безопасен.

-1
задан 19 April 2013 в 05:59
1 ответ

В основном, если вы хотите выполнить аутентификацию SASL через MySQL, у вас есть 3 варианта

  1. ] Использование pam-mysql и saslauthd. В вашем связанном руководстве используется это.
  2. Использование подключаемого модуля sql auxprop. Вы определили этот метод в файле /etc/postfix/sasl/smtpd.conf выше.
  3. Использование dovecot вместо cyrus SASL (варианты 1 и 2). Давайте dovecot предоставит вам сокет аутентификации.

Вы заявляете, что следовали методу 1 из приведенного выше руководства. И все же вы используете метод 2 в своем файле конфигурации. Этот микс никогда не увенчается успехом.

Предположим, вы хотите выполнить метод 2, тогда вам нужно изменить pwcheck_method в /etc/postfix/sasl/smtpd.conf на

pwcheck_method: auxprop

. И вы можете безопасно остановить демон saslauthd.

Ссылки: Postfix SASL Readme

2
ответ дан 5 December 2019 в 19:30

Теги

Похожие вопросы