Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux postfix/dovecot 554中继访问被拒绝_Linux_Smtp_Postfix Mta_Mail Server_Dovecot - Fatal编程技术网

Linux postfix/dovecot 554中继访问被拒绝

Linux postfix/dovecot 554中继访问被拒绝,linux,smtp,postfix-mta,mail-server,dovecot,Linux,Smtp,Postfix Mta,Mail Server,Dovecot,尝试从outlook客户端发送电子邮件时,我出现此错误554中继访问被拒绝 我可以阅读收到的邮件,但不能发送 如果我使用telnet localhost 25连接,我可以发送外部电子邮件,但使用outlook客户端则无法工作 这是我的后缀和dovecot配置: postconf-n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_

尝试从outlook客户端发送电子邮件时,我出现此错误
554中继访问被拒绝

我可以阅读收到的邮件,但不能发送

如果我使用telnet localhost 25连接,我可以发送外部电子邮件,但使用outlook客户端则无法工作

这是我的后缀和dovecot配置:

postconf-n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = localhost
myhostname = mail.mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem
smtpd_tls_key_file = /etc/ssl/private/dovecot.pem
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.9.3-x86_64-linode33 x86_64 Ubuntu 13.04 ext3
auth_mechanisms = plain login
mail_location = maildir:/var/mail/vhosts/%d/%n
mail_privileged_group = mail
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 {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3 lmtp
service auth-worker {
  user = vmail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
  user = dovecot
}
service imap-login {
  inet_listener imap {
    port = 0
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 0
  }
}
ssl = required
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
  driver = static
}
userdb {
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
  driver = static
}
doveconf-n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = localhost
myhostname = mail.mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem
smtpd_tls_key_file = /etc/ssl/private/dovecot.pem
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.9.3-x86_64-linode33 x86_64 Ubuntu 13.04 ext3
auth_mechanisms = plain login
mail_location = maildir:/var/mail/vhosts/%d/%n
mail_privileged_group = mail
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 {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3 lmtp
service auth-worker {
  user = vmail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
  user = dovecot
}
service imap-login {
  inet_listener imap {
    port = 0
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 0
  }
}
ssl = required
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
  driver = static
}
userdb {
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
  driver = static
}
#2.1.7:/etc/dovecot/dovecot.conf
#操作系统:Linux 3.9.3-x86_64-linode33 x86_64 Ubuntu 13.04 ext3
验证机制=普通登录
mail_location=maildir:/var/mail/vhosts/%d/%n
mail\u privileged\u group=邮件
命名空间收件箱{
收件箱=是
位置=
邮箱草稿{
特殊用途=\Drafts
}
邮箱垃圾{
特殊用途=\垃圾
}
已发送邮箱{
特殊用途=\Sent
}
邮箱“已发送邮件”{
特殊用途=\Sent
}
邮箱垃圾{
特殊用途=\Trash
}
前缀=
}
passdb{
args=/etc/dovecot/dovecot-sql.conf.ext
驱动程序=sql
}
passdb{
args=/etc/dovecot/dovecot-sql.conf.ext
驱动程序=sql
}
协议=imap pop3 lmtp
服务身份验证工作者{
用户=vmail
}
服务认证{
unix_侦听器/var/spool/postfix/private/auth{
组=后缀
模式=0666
用户=后缀
}
unix_侦听器身份验证用户数据库{
模式=0600
用户=vmail
}
用户=dovecot
}
服务imap登录{
inet_侦听器imap{
端口=0
}
}
服务lmtp{
unix_侦听器/var/spool/postfix/private/dovecot lmtp{
组=后缀
模式=0600
用户=后缀
}
}
服务pop3登录{
inet_侦听器pop3{
端口=0
}
}
ssl=必需

ssl_cert=如果使用比2.10更新的后缀版本,则需要添加
smtpd_relay_restrictions
选项,如下所述:

#对于Postfix 2.10及更高版本,邮件中继策略是 #最好在smtpd_继电器_限制下指定。 /etc/postfix/main.cf: smtpd_继电器_限制= 许可证网络 经认证的许可证 拒绝取消目的地 #较旧的配置将中继控制和垃圾邮件控制结合在一起 #smtpd_收件人_限制。将此示例与后缀一起使用≥ #2.10指定“smtpd_继电器限制”。 /etc/postfix/main.cf: smtpd_收件人_限制= 许可证网络 经认证的许可证 拒绝取消目的地 …其他规则。。。
在那之后,任何sasl认证的用户都应该能够使用smtp通过服务器发送邮件。

对于我在Amazon AWS EC2上的postfix 2.6.6,结果证明我在main.cf中的“mydestination”和“relay_domains”设置配置错误。 正确的值(对我有效的值)是:

mydestination=$myhostname、$mydomain、localhost
中继\域=$mydestination

您的“outlook客户端”从何处连接?您正在使用身份验证吗?您在
mynetworks
中只有localhost,您可能需要添加网络计算机,该网络计算机应允许从那里发送邮件。它位于我的家庭计算机中。是的,我使用ssl。我的网络?因此,我应该添加我的家用计算机inet ip??不,我不是指ssl(加密),而是身份验证(您是否已设置outlook以在通过postfix通过smtp发送邮件时对用户进行身份验证?)
mynetwork
允许中继访问,而无需从本地网络进行身份验证。如果您的服务器位于internet上的某个位置,则最好使用smtp\u auth。@mata确定我没有在outlook中设置smtp身份验证。但是我仍然有认证错误。因此,我应该在后缀配置中添加smtp_auth?@mata hey我添加了
smtpd_relay_restrictions
,参数与
smtpd_recipient_restrictions
相同,它可以工作!我刚刚看到,smtpd的收件人限制是只允许在本地发送电子邮件!谢谢。您可以添加答案,如果您希望我的域名是
necktwi.com
,我会接受。我已将服务器重命名为
ec2
,因此myhostname=
ec2.necktwi.com
和mydomain=
necktwi.com
。但我也犯了同样的错误