Postfix/Dovecot 接收邮件问题

Postfix/Dovecot 接收邮件问题

我在使用 PostFix 和 Dovecot 时遇到了问题。我遵循了以下指南:https://github.com/opensolutions/ViMbAdmin/wiki/Mail-System-Install-on-Ubuntu 当邮件发送到服务器时,这会记录在 mail.log 中

Oct 26 12:40:11 vps31465 postfix/smtpd[13551]: connect from nm3-vm2.bt.bullet.mail.ir2.yahoo.com[212.82.99.122]
Oct 26 12:40:11 vps31465 postfix/smtpd[13551]: warning: SASL: Connect to private/dovecot-auth failed: No such file or directory
Oct 26 12:40:11 vps31465 postfix/smtpd[13551]: fatal: no SASL authentication mechanisms
Oct 26 12:40:12 vps31465 postfix/master[13383]: warning: process /usr/lib/postfix/smtpd pid 13551 exit status 1
Oct 26 12:40:12 vps31465 postfix/master[13383]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

这是我从 postfix -n 输出的:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${EXTENSION}"
mailbox_size_limit = 0
mydestination = polynet.me, vps31465.vps.ovh.ca, localhost.vps.ovh.ca, localhost
myhostname = vps31465.vps.ovh.ca
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

我从 doveconf -n 输出

root@vps31465:~# doveconf -n
# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-042stab093.5 x86_64 Ubuntu 14.04.1 LTS
mail_location = mbox:~/mail:INBOX=/var/mail/%u
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
  inbox = yes
  location =
  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 =
}
passdb {
  driver = pam
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = " imap lmtp sieve pop3"
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  driver = passwd
}

域名是 mail.polynet.me。

我不知道我哪里做错了。

非常感谢您的帮助:)

答案1

好的,首先看起来您的传入邮件交易在 SASL 身份验证方面遇到了问题。

Oct 26 12:40:11 vps31465 postfix/smtpd[13551]: warning: SASL: Connect to private/dovecot-auth failed: No such file or directory

这条路径看起来是从这里来的,我假设这是postconf输出(与您描述如何获得它相反):

smtpd_sasl_path = private/dovecot-auth

这是套接字的路径,相对于 $queue_directory。我不确定为什么它不在您的(假设的)postconf 输出中。在我的系统上它是 /var/spool/postfix。

因此请检查该路径是否存在(可能不存在)

您的doveconf -n输出实际上看起来像是 postconf 输出的重复,所以我只能做这么多。在我的系统上,我有这样一个节:

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

这将创建 postfix 与之通信以发送电子邮件的套接字。您将套接字文件命名dovecot-auth为 而不是auth,这似乎很合理。但我猜您在配置 postfix 与之通信的套接字时出了点问题。

请修复问题中的配置列表,否则我可能不得不投反对票。

编辑:我查看了您使用的链接。它引用了 Dovecot 设置说明的要点,我认为您完全错过了。

答案2

现在我又取得了一点进展,我遇到了以下问题。

    Oct 26 18:07:54 vps31465 postfix/lmtp[14820]: 751721E2624: to=<[email protected]>, relay=none, delay=0.44, delays=0.43/0.01/0/0, dsn=4.4.1, status=deferred (connect to vps31465.vps.ovh.ca[private/dovecot-lmtp]: No such file or directory)
Oct 26 18:07:54 vps31465 postfix/smtpd[14812]: F38391E2628: client=nm5-vm2.bt.bullet.mail.ir2.yahoo.com[212.82.99.124]
Oct 26 18:07:55 vps31465 postfix/cleanup[14817]: F38391E2628: message-id=<[email protected]>
Oct 26 18:07:55 vps31465 postfix/smtpd[14818]: disconnect from nm5-vm2.bt.bullet.mail.ir2.yahoo.com[212.82.99.124]
Oct 26 18:07:55 vps31465 postfix/qmgr[14797]: F38391E2628: from=<[email protected]>, size=18027, nrcpt=1 (queue active)
Oct 26 18:07:55 vps31465 postfix/lmtp[14820]: F38391E2628: to=<[email protected]>, relay=none, delay=0.41, delays=0.41/0/0/0, dsn=4.4.1, status=deferred (connect to vps31465.vps.ovh.ca[private/dovecot-lmtp]: No such file or directory)
Oct 26 18:07:55 vps31465 postfix/smtpd[14812]: disconnect from nm5-vm2.bt.bullet.mail.ir2.yahoo.com[212.82.99.124]
Oct 26 18:08:15 vps31465 postfix/smtpd[14818]: connect from localhost[::1]
Oct 26 18:08:15 vps31465 postfix/smtpd[14818]: BA6271E262C: client=localhost[::1]
Oct 26 18:08:15 vps31465 postfix/cleanup[14817]: BA6271E262C: message-id=<[email protected]>
Oct 26 18:08:15 vps31465 postfix/qmgr[14797]: BA6271E262C: from=<[email protected]>, size=2513, nrcpt=1 (queue active)
Oct 26 18:08:15 vps31465 postfix/smtpd[14818]: disconnect from localhost[::1]
Oct 26 18:08:15 vps31465 postfix/lmtp[14820]: BA6271E262C: to=<[email protected]>, relay=none, delay=0.54, delays=0.54/0/0/0, dsn=4.4.1, status=deferred (connect to vps31465.vps.ovh.ca[private/dovecot-lmtp]: No such file or directory)

我不确定如何继续。这些是我当前的 Postfix 配置:

# 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 (Ubuntu)
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 = no

# TLS parameters
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

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

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = vps31465.vps.ovh.ca
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =  vps31465.vps.ovh.ca, localhost.vps.ovh.ca, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${EXTENSION}"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = reject_unknown_sender_domain
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = mysql:/etc/postfix/mysql/virtual_alias_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /srv/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_uid_maps = static:2000
#dovecot_destination_recipient_limit = 1
virtual_transport = lmtp:unix:private/dovecot-lmtp

还有我的鸽舍:

 root@vps31465:/etc/dovecot# dovecot -n
# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-042stab093.5 x86_64 Ubuntu 14.04.1 LTS
mail_location = mbox:~/mail:INBOX=/var/mail/%u
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
  inbox = yes
  location =
  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 =
}
passdb {
  driver = pam
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = " imap lmtp sieve pop3"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  driver = passwd
}

知道我现在缺少什么吗?

相关内容