Linux后缀/ dovecot 554中继访问被拒绝

当我尝试从Outlook客户端发送电子邮件时,我有这个错误554 Relay access denied

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

如果我连接telnet localhost 25我可以发送外部电子邮件,但与Outlook客户端不起作用。

这是我的后缀和dovecotconfiguration:

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 

doveconf -n

 # 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 } 

有什么想法吗?

Solutions Collecting From Web of "Linux后缀/ dovecot 554中继访问被拒绝"

如果您使用的是较新的2.10版本,则需要添加smtpd_relay_restrictions选项,如下所述:

 #使用Postfix 2.10和更高版本,邮件转发策略是
 #最好在smtpd_relay_restrictions下指定。
 /etc/postfix/main.cf文件:
     smtpd_relay_restrictions =
     permit_mynetworks
     permit_sasl_authenticated
     reject_unauth_destination

 #老的配置结合了中继控制和垃圾邮件控制
 #smtpd_recipient_restrictions。 用Postfix≥来使用这个例子
 #2.10指定“smtpd_relay_restrictions =”。
 /etc/postfix/main.cf文件:
     smtpd_recipient_restrictions =
     permit_mynetworks
     permit_sasl_authenticated
     reject_unauth_destination
        其他规则...

之后,任何sasl认证的用户都应该能够使用smtp通过服务器发送邮件。

对于我在Amazon AWS EC2上的postfix 2.6.6,事实证明我在main.cf中配置了“mydestination”和“relay_domains”设置。 正确的价值观(为我工作的)是:

mydestination = $myhostname, $mydomain, localhost relay_domains = $mydestination