LINUX.ORG.RU

Не работает postfix

 


0

1

Уже пару дней мучаюсь с этим. При входящем подключении к моему smtp серверу вылезает ошибка

warning: SASL: Connect to private/auth # ????. ???????????? Dovecot failed: No such file or directory

По идеи всё настроено правильно.

queue_directory = /var/spool/postfix



smtpd_sasl_auth_enable=yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
unix_listener /var/spool/postfix/private/auth {
        user = postfix
        group = postfix
        mode = 0660
    }
    unix_listener auth-master {
        user = vmail
        group = vmail
        mode = 0660
    }

Уже перерыл весь поисковик, везде предлагают заменить

smtpd_sasl_path = /var/spool/postfix/private/auth на private/auth.
Но у меня и так стоит. Файл в папке есть, права есть. Логинился под postfix, всё работает.

Не понимаю в какую сторону копать и как дебажить это?

dovecot ошибок не пишет. Только сам postfix


Ответ на: комментарий от anonymous

became a searcher,wanting to discover who i was and what made me precise. my view of myself turned into changing. i desired a stable base to start from. i commenced to resist3 stress to behave in ways that i didn’t like any greater,and i used to be delighted by who i in reality become. i got here to feel a good deal extra sure that no one can ever take my region. https://www.getnewreview.com

getnewr3
()

postfix пишет ,что не может подключиться к dovecot. видимо к его сокету.

полный конфиг postfix main.cf и master.cf и конфиг dovecot надо бы показать

constin ★★★★
()
Последнее исправление: constin (всего исправлений: 1)
Ответ на: комментарий от constin

А вот это интересно что postfix не может подключиться к dovecot. Можешь рассказать с чего такие предположения, ошибка же «No such file or directory» , а не типа «permissions что-то там» или похожие. Я с сокетами дело особо не имел, может чего не понимаю

Azerot
() автор топика
Ответ на: комментарий от Azerot
grep -R "private/auth"  /etc/dovecot/*
/etc/dovecot/conf.d/conf.d/10-master.conf:  unix_listener /var/spool/postfix/private/auth {

ls -l /var/spool/postfix/private/auth
srw-rw----. 1 postfix postfix 0 Jan  4 00:59 /var/spool/postfix/private/auth

Всё аналогично?

ssh2 ★★★★
()
Последнее исправление: ssh2 (всего исправлений: 1)
Ответ на: комментарий от ssh2

Я через dovecot.conf все настройки сделал)

grep -R «private/auth» /etc/dovecot/* /etc/dovecot/conf.d/10-master.conf: #unix_listener /var/spool/postfix/private/auth { /etc/dovecot/dovecot.conf: unix_listener /var/spool/postfix/private/auth {

Тоже самое что у вас)

Azerot
() автор топика
Ответ на: комментарий от Azerot

Я через dovecot.conf все настройки сделал)

grep -R "private/auth"  /etc/dovecot/*
/etc/dovecot/conf.d/10-master.conf:  #unix_listener /var/spool/postfix/private/auth {
/etc/dovecot/dovecot.conf:    unix_listener /var/spool/postfix/private/auth {

Тоже самое что у вас)

Azerot
() автор топика
Ответ на: комментарий от Azerot

я рассказывать не буду особо, времени на это нет. но сутьв том, что postfix обычно настраивают так, чтобы он отдавал входящее на MDA(dovecot в твоем случае). отдавать он может по разному, для этого у него в master.cf прописывется пайп, а в main.cf указыватся имя пайпа.

в пайпе прописано куда кидать почту, обычно это делается через сокет. если не углубляться, то это файл, который твой постфикс не может найти. а значит, либо там указано неправильно, либо dovecot его не создал, либо прав нет. короче я попросил конфиги, чтобы быстро решить твою проблему и забыть.

constin ★★★★
()
Ответ на: комментарий от ssh2

Аналогично) [code]/etc/postfix/main.cf:smtpd_sasl_path = private/auth [/code]

Azerot
() автор топика
Ответ на: комментарий от constin

Держи

### Common config
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix/sbin
data_directory = /var/lib/postfix
myhostname = mail.Тут мой домен
mydomain = Тут мой домен
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost, localhost.localdomain
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8
#in_flow_delay = 1s
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

local_recipient_maps = $virtual_mailbox_maps, $virtual_alias_maps

home_mailbox = Maildir/
mail_spool_directory = /var/spool/mail
smtpd_banner = $myhostname ESMTP $mail_name
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix


# The mail_owner parameter specifies the owner of the Postfix queue
# and of most Postfix daemon processes.  Specify the name of a user
# account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
# AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.  In
# particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
# USER.
#
mail_owner = postfix
# setgid_group: The group for mail submission and queue management
# commands.  This must be a group name with a numerical group ID that
# is not shared with other accounts, not even with the Postfix account.
#
setgid_group = postdrop

html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

virtual_transport = dovecot
dovecot_destination_recipient_limit=1

### Auth
smtpd_sasl_auth_enable=yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
#smtpd_sasl_path = smtpd
smtpd_sasl_path = private/auth # см. конфиг Dovecot
#smtpd_sasl_path = /var/spool/postfix/private/auth
### Relay Domains:
#relay_domains = mysql:/etc/postfix/sql/mysql_relay_domains.cf

### Virtual Domains:
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains =
   mysql:/etc/postfix/sql/virtual_mailbox_domains.cf
virtual_alias_maps =
   mysql:/etc/postfix/sql/virtual_alias_maps.cf
virtual_mailbox_maps =
   mysql:/etc/postfix/sql/virtual_mailbox_maps.cf

virtual_minimum_uid = 5000
virtual_minimum_gid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

### Quotas
# Квоты пока не проверял
#virtual_create_maildirsize = yes
#virtual_mailbox_extended = yes
#virtual_mailbox_limit_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf
#virtual_mailbox_limit_override = yes
#virtual_maildir_limit_message = "Sorry, the user's maildir has overdrawn his diskspace quota."
#virtual_overquota_bounce = yes

### Restrictions
smtpd_client_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_unknown_reverse_client_hostname,
        permit

smtpd_helo_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_invalid_helo_hostname,
        reject_non_fqdn_helo_hostname,
        reject_unknown_helo_hostname,
        permit

smtpd_sender_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_sender,
        reject_unknown_sender_domain,
        reject

smtpd_recipient_restrictions =
        reject_non_fqdn_recipient,
        reject_unknown_recipient_domain,
        permit_sasl_authenticated,
        reject_unlisted_recipient,
        permit_mynetworks,
        reject_unauth_destination,
        reject

smtpd_data_restrictions =
    permit_mynetworks,
    reject_unauth_pipelining,
    reject_multi_recipient_bounce,
    permit

smtpd_etrn_restrictions = reject
smtpd_helo_required = yes

#strict_rfc821_envelopes = yes

smtpd_discard_ehlo_keywords = etrn, silent-discard
smtpd_forbidden_commands = CONNECT GET POST
disable_vrfy_command = yes

### TLS
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.Тут мой домен/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.Тут мой домен/privkey.pem
smtp_tls_security_level=may
smtpd_tls_mandatory_protocols=TLSv1, TLSv1.1, TLSv1.2, TLSv1.3, !SSLv2, !SSLv3
smtpd_tls_auth_only = yes

smtp_tls_loglevel = 1
smtpd_tls_loglevel = 1

### Secure headers
# Погуглите на эту тему - интересно!
#header_checks = regexp:/etc/postfix/header_checks

Azerot
() автор топика
Ответ на: комментарий от Azerot
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
smtp      inet  n       -       y       -       -       smtpd
#smtp      inet  n       -       y       -       1       postscreen
#smtpd     pass  -       -       y       -       -       smtpd
#dnsblog   unix  -       -       y       -       0       dnsblog
#tlsproxy  unix  -       -       y       -       0       tlsproxy
#submission inet n       -       y       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_tls_auth_only=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       y       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       y       -       -       qmqpd
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
        -o syslog_name=postfix/$service_name
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
postlog   unix-dgram n  -       n       -       1       postlogd
#
# ====================================================================
# 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=DRXhu 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
#  flags=DRX 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=FRX 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)

Azerot
() автор топика
Ответ на: комментарий от Azerot
 Не использую специализированные файлы из поставки Dovecot из папки /etc/dovecot/conf.d/.
# Основная причина: сравнительно небольшой размер всего конфига (все перед глазами, нет необходимости раскидывать по отдельным файлам).
#!include conf.d/*.conf

# Нет необходимости явно указывать imaps и pop3s - Dovecot 2.* по-умолчанию их включает.
protocols = imap
listen = *

# Завершать все дочерние процессы, если завершен мастер-процесс
shutdown_clients = yes

# Владелец почтовых папок (также см. конфиг Postfix):
mail_uid = vmail
mail_gid = vmail

# Только наш пользователь с uid и gid 5000 (vmail) может быть использован.
first_valid_uid = 5000
last_valid_uid = 5000

# Лог-файлы. Подробнее: http://wiki2.dovecot.org/Logging
log_path = /var/log/dovecot.log
# Отладка. Если все настроено, отключаем (no)
# http://maint.unona.ru/doc/dovecot2.shtml
mail_debug = yes
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes

# SSL
# http://wiki2.dovecot.org/SSL/DovecotConfiguration
ssl = required
ssl_cert = </etc/dovecot/fullchain1.pem
ssl_key = </etc/letsencrypt/live/mail.Мой домен/privkey.pem

#ssl_protocols = TLSv1.1 TLSv1.2
ssl_min_protocol=TLSv1
ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL

# Запрет аутентификации открытым текстом. yes - запретить, no - разрешить.
disable_plaintext_auth = yes

# Список разрешенных символов в имене пользователя.
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@

# Расположение и формат файлов почты (%d - домен, %n - имя пользователя).
mail_location = maildir:/var/vmail/%d/%n

# Если при аутентификации не указан домен, то добавить этот (в данном примере - пустой)
auth_default_realm =

# Доступные варианты аутентификации (PLAIN, DIGEST-MD5, CRAM-MD5...).
# Для того, чтобы иметь меньше головной боли ставьте PLAIN
auth_mechanisms = PLAIN

# Приветственное сообщение
login_greeting = POP3/IMAP server ready.

# Одно из самых важных мест - предоставление сокетов для аутентификации пользователей.
# Если настроено неверно - ничего работать не будет!
service auth {
    # http://maint.unona.ru/doc/dovecot2.shtml
    # Указывает, что данный сокет будет использовать SMTP сервер для аутентификации.
    # Указывается пользователь, группа и права доступа к сокету. В данном случае это postfix
    # ("mail_owner = postfix" в файле /etc/postfix/main.cf).
    unix_listener /var/spool/postfix/private/auth {
        user = postfix
        group = postfix
        mode = 0660
    }
    unix_listener auth-master {
        user = vmail
        group = vmail
        mode = 0660
    }
    unix_listener auth-userdb {
        user = vmail
        group = vmail
        mode = 0660
    }
}


service stats {
    unix_listener stats-reader {
        user = vmail
        group = www-data
        mode = 0660
    }

    unix_listener stats-writer {
        user = vmail
        group = www-data
        mode = 0660
    }
}

# Запрос параметров виртуальных почтовых пользователей
# (логин, пароль, домен, активный/неактивный и др.)
userdb {
    args = /etc/dovecot/dovecot-mysql.conf
    driver = sql
}
passdb {
    args = /etc/dovecot/dovecot-mysql.conf
    driver = sql
}

# Plugins

protocol imap {
    imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
    mail_plugins = autocreate
}
protocol pop3 {
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
    pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
    # Куда будут перенаправлены недоставленные письма
    postmaster_address = postmaster@localhost
    auth_socket_path = /var/run/dovecot/auth-master
}


plugin {
    auth_socket_path = /var/run/dovecot/auth-master

    # Plugin: autocreate. Создаем и подписываемся на папки IMAP.
    autocreate = INBOX
    autocreate2 = Sent
    autocreate3 = Trash
    autocreate4 = Drafts
    autocreate5 = Junk
    autosubscribe = INBOX
    autosubscribe2 = Sent
    autosubscribe3 = Trash
    autosubscribe4 = Drafts
    autosubscribe5 = Junk

    # Plugin: квоты. Пока отключим.
    # http://wiki2.dovecot.org/Quota/Configuration
    #quota = maildir:User quota
    #quota_rule = *:storage=1GB
    #quota_rule2 = Trash:storage=+10%% # 10% of 1GB = 100MB
    #quota_rule3 = Junk:storage=+10%% # 10% of 1GB = 100MB
    #quota_rule4 = Drafts:storage=+10%% # 10% of 1GB = 100MB
}

Azerot
() автор топика
Ответ на: комментарий от Azerot

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

А можно dovecot -n | grep unix_listener , чтобы быть уверенным, что мы юзаем именно этот конфиг?

constin ★★★★
()
Ответ на: комментарий от Azerot

Проблему решил. Оказалось что конфиг продолжает читать строчку после #

Azerot
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.