POSTFIX 和 DOVECOT,接收 OK 发送 KO

POSTFIX 和 DOVECOT,接收 OK 发送 KO

我已经使用 ubuntu 安装了 postfix 和 dovecot(1.2.12)。

这是我的主配置文件

alias_maps = 
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydomain = example.net
myhostname = mail.example.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relayhost = 
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_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_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
tls_random_source = dev:/dev/urandom
virtual_gid_maps = static:5001
virtual_mailbox_base = /home/postfix/vmail
virtual_mailbox_domains = /etc/postfix/virtual_domains
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_uid_maps = static:5001

这是我的dovecot配置文件

protocols = imap imaps

log_timestamp = "%Y-%m-%d %H:%M:%S "

log_path = /var/log/dovecot.log

mail_privileged_group = vmail

protocol imap {
        mail_max_userip_connections = 10
}

auth default {
        mechanisms = plain login

        # imaps/ smtp user database
        passdb passwd-file {
                args = /home/postfix/vmail/passwd
        }

        # all mail is mapped to this user.
        userdb static {
                args = uid=vmail gid=vmail home=/home/postfix/vmail/%d/%n
        } 


        user = root
        !include_try /etc/dovecot/auth.d/*.auth
}
dict {
}
plugin {
}
!include_try /etc/dovecot/conf.d/*.conf

(conf.d/ 和 auth.d/ 是空的)

我在日志中没有看到错误,但是通过这种配置,我可以接收电子邮件,但无法发送电子邮件...我总是出现此错误:

中继访问被拒绝

我正在尝试从我的帐户向 @gmail.com 帐户发送电子邮件

有什么问题吗?谢谢!

答案1

postfix 和 dovecot 以及电子邮件客户端本身在同一台机器上吗?

如果没有,您需要修改 mynetworks 以包含您的 IP 范围。

编辑:抱歉,没看到你正在使用 SASL。你应该在尝试通过 telnet 发送电子邮件时测试 SASL 是否正常工作。有关于如何执行此操作的文章。

相关内容