mydomain.com上有一个Ubuntu 14.04服务器,有一堆用户在login时使用@domain ,比如[email protected] 。 us.er-mydomain.com与相同的uid, passwd和shadow条目。 /etc/postfix/virtual有一个入口: [email protected] us.er-mydomain.com 。 (这些用户在CentOS上从Virtualmin迁移) 。
我的服务器拒绝邮件错误:
Dec 6 10:27:31 mydomain postfix/smtpd[8176]: NOQUEUE: reject: RCPT from lalala.asdfasdf.com[220.232.206.13]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[email protected]>
虽然它有一个[email protected]帐户。
我没有设置myhostname或mydomain 。 如果我将它们设置为我的服务器域,postmap开始拒绝具有unknown user: "us.er"邮件unknown user: "us.er"消息。
什么是解决SMTP接收的最佳方法? 这个设置有什么不对吗?
Imap和pop3或多或less地工作。 configuration转储如下。
主机名
some-isp-vps
主机名-f
mydomain.com
postconf -n
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases allow_percent_hack = no broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/lib/postfix data_directory = /var/lib/postfix 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 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailbox_size_limit = 0 mailq_path = /usr/bin/mailq manpage_directory = /usr/share/man message_size_limit = 30485760 milter_default_action = accept milter_protocol = 2 mydestination = $myhostname, localhost.$mydomain, localhost, vp1.mydomain.com mynetworks = 192.241.228.147,127.0.0.1 newaliases_path = /usr/bin/newaliases queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sender_bcc_maps = hash:/etc/postfix/bcc sendmail_path = /usr/sbin/sendmail setgid_group = postdrop smtp_tls_note_starttls_offer = yes smtp_tls_security_level = may smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,permit_auth_destination,reject_unauth_destination smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,permit_auth_destination,reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_auth_only = no smtpd_tls_cert_file = /etc/ssl/certs/ssl.cert smtpd_tls_key_file = /etc/ssl/certs/ssl.key smtpd_tls_loglevel = 1 smtpd_tls_mandatory_ciphers = high smtpd_tls_received_header = yes smtpd_tls_security_level = may tls_random_source = dev:/dev/urandom unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual
postconf -M
smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes smtps inet n - n - - smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING pickup fifo n - n 60 1 pickup cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - n - - smtp relay unix - - n - - smtp -o smtp_fallback_relay= showq unix n - n - - showq error unix - - n - - error retry unix - - n - - error discard unix - - n - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache submission inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes
Postfix拒绝中继到mydomain.com,因为没有列为本地域或虚拟域。 第一步是定义域类(postfix.org/ADDRESS_CLASS_README.html)。 myhostname是机器名称。 mydestination是一个列表,其中包含域名托pipe和用户在passwd列出。
你的postfix smtpd进程正在抱怨:
<[email protected]>: Relay access denied
因为:
和
因此,无法提供本地(如第1点)和远程(如第2点),它会发出您正面临的“中继访问被拒绝”错误。
根据你的configuration,你的问题是第1点:你想你的后缀是mydomain.com域的最终目的地,但后缀…还不知道这一点。 你有两种方法来解决这个问题:
A) mydestination指令: “…通过$ local_transport邮件传递传输的域名列表….” 。 不幸的是,你的configuration设置:
mydestination = $ myhostname,localhost。$ mydomain,localhost,vp1.mydomain.com
不包括单独的$ mydomain ;
一个非常重要的注意事项:您必须仔细select是否将您的托pipe域名包含在“ mydestination ”或“ virtual_mailbox_domain ”中,因为它可能会对您的计算机强制在本地创build的unix帐户造成严重的安全隐患。 在你的消息中,你写道:
“…他们每个人都有一个”伪“帐户us.er-mydomain.com与同样的uid,passwd和shadow条目….”
所以你清楚地引用了/ etc / passwd和/ etc / shadow。 因此,他们是真正的帐户!
一般来说,如果您select“mydestination”路线,那么您大多被迫将REAL帐户关联到您所托pipe的每个邮箱。 如果您仅托pipe您自己的单个域,则这不是一个严重的问题。
相反,当你要托pipe几个域名时,它很快就会变成一场噩梦。 在这种情况下,你可能只提供给你的用户电子邮件服务和…设置一个真正的Unix帐户,每个人都是太多了。
这就是为什么从Postfix 2.0开始添加virtual_mailbox_domains的原因。
最后:您已经解决了您的问题,将您的域添加到虚拟域列表中。 还行吧。 但是这个设置不需要真正的unix帐户来定义。
我build议你检查的一个非常明确的例子是: Postfix虚拟MAILBOX示例:单独的域,非UNIX帐户