繁体   English   中英

无法使用后缀向外部发送邮件

[英]Can't send mails outside using postfix

我在服务器下面:

    [root@SR5S2]# uname -a
Linux SR5S2 2.6.16.60-0.74.7-smp #1 SMP Fri Nov 26 09:16:10 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@SR5S2]# 

我已经配置

/etc/postfix/main.cf中

像这样的文件(我在这里删除了所有注释,以使其更容易变红):

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
mydomain = EXCHANGESERVER.COM
myorigin = EXCHANGESERVER.COM
inet_interfaces = localhost                        
mydestination = 10.220.1.1
unknown_local_recipient_reject_code = 550
relay_domains = 10.220.1.1                      
relayhost = 10.220.1.1
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = maildrop
html_directory = /usr/share/doc/packages/postfix/html
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples
readme_directory = /usr/share/doc/packages/postfix/README_FILES
inet_protocols = all
biff = no
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = EXCHANGESERVER.COM
program_directory = /usr/lib/postfix
defer_transports = 
relayhost = 10.220.1.1
mailbox_command = 
mailbox_transport = 
strict_8bitmime = no
disable_mime_output_conversion = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_helo_required = no
smtpd_helo_restrictions = 
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtp_sasl_auth_enable = yes
smtpd_sasl_auth_enable = no
smtpd_use_tls = no
smtp_use_tls = no
mailbox_size_limit = 0
message_size_limit = 10240000

我重新启动了postfix服务

/etc/init.d/postfix restart

但是,当我尝试发送邮件(尝试使用sendmail,mail和mailx并获得完全相同的结果)时,我在/ var / log / mail中收到以下消息:

Apr 19 17:43:47 SR5S2 postfix/pickup[15543]: A74F5DEC74: uid=0 from=<root>
Apr 19 17:43:47 SR5S2 postfix/cleanup[25616]: A74F5DEC74: message-id=<20170419134347.A74F5DEC74@EXCHANGESERVER.COM>
Apr 19 17:43:47 SR5S2 postfix/qmgr[15544]: A74F5DEC74: from=<root@EXCHANGESERVER.COM>, size=344, nrcpt=1 (queue active)
Apr 19 17:43:47 SR5S2 postfix/qmgr[15544]: A74F5DEC74: to=<MAIL@EXCHANGESERVER.COM>, relay=none, delay=0.04, delays=0.03/0.01/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)

哪些状态未配置中继。 但事实是,可以从main.cf上看到它-已配置。

任何提示为什么我会收到此错误? 在哪里可以解决此问题? 在此问题上已经花费2天了,没有任何成功:(


这是postconf -n的输出:

[root@SR5S2]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
biff = no
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
defer_transports = 
disable_dns_lookups = no
disable_mime_output_conversion = no
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = 10.10.10.10
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command = 
mailbox_size_limit = 0
mailbox_transport = 
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = 10.220.1.1
mydomain = EXCHANGESERVER.COM
myhostname = EXCHANGESERVER.COM
mynetworks_style = subnet
myorigin = azerconnect.az
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relay_domains = 10.220.1.1
relayhost = 10.220.1.1
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = yes
smtp_use_tls = no
smtpd_helo_required = no
smtpd_helo_restrictions = 
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_use_tls = no
strict_8bitmime = no
strict_rfc821_envelopes = no
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
[root@SR5S2]#
inet_interfaces = localhost

将此更改为您的IP。

当您重新加载postfix时,在/ var / log / mail中是否有任何特定于重新加载操作的错误?

您应该会看到一些东西,因为带有相反选项的smtpd_sasl_auth_enable至少是重复的

还为所有属性文件生成了.db吗? 我确定您知道,但以防万一“ postmap文件名”

这个main.cf看起来有点混乱,您确定需要在其中启用所有这些功能吗? 我会尝试整理一下,只启用可以肯定知道和需要的内容。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM