后缀 - 连​​接到127.0.0.1 [127.0.0.1]:10024:连接被拒绝)

时间:2015-05-20 12:12:22

标签: linux debian postfix-mta

我有一个反复出现的postfix问题(在Debian Squeeze上,amavisd-new和fail2ban也已安装):突然间,经常在晚上(但并非总是如此),邮件停止传递并且队列已满。日志显示了这种风格的一系列条目:

May 18 19:54:16 ks4000003 postfix/error[6889]: 376352016039: to=<info@xxxxxxx>, relay=none, delay=0.62, delays=0.58/0.01/0/0.04, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

一旦我重新启动服务器,它就会工作(并且队列全部被清除)。直到下一次(通常每1-2周一次,但最近每天早上我必须重新启动服务器)它仍然没有任何问题。

对此的任何想法都将非常感激。我应该提一下,我真的是服务器管理的新手;我在google / stackoverflow上搜索了类似的问题,找不到真正类似的问题。

我的后缀conf:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
always_add_missing_headers = yes
append_dot_mydomain = no
biff = no
body_checks = regexp:/etc/postfix/body_checks
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
header_checks = regexp:/etc/postfix/header_checks
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_size_limit = 0
message_size_limit = 0
mime_header_checks = regexp:/etc/postfix/mime_header_checks
mydestination = ks4000003.ip-198-245-60.net, localhost, localhost.localdomain
myhostname = ks4000003.ip-198-245-60.net
mynetworks = 127.0.0.0/8 [::1]/128
myorigin = /etc/mailname
nested_header_checks = regexp:/etc/postfix/nested_header_checks
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
relayhost = 
smtp_destination_concurrency_limit = 5
smtp_destination_rate_delay = 1s
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
smtpd_error_sleep_time = 0
smtpd_recipient_restrictions = check_client_access hash:/etc/postfix/rbl_whitelist, permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unknown_recipient_domain, reject_unauth_destination, reject_unverified_sender, reject_unauth_destination,reject_unlisted_recipient, reject_invalid_hostname, reject_non_fqdn_sender, reject_rbl_client cbl.abuseat.org, reject_rbl_client bl.spamcop.net, reject_rbl_client sbl.spamhaus.org, reject_rbl_client truncate.gbudb.net
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access mysql:/etc/postfix/mysql-virtual_sender.cf reject_non_fqdn_sender reject_unknown_sender_domain
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000

1 个答案:

答案 0 :(得分:4)

首先是amavis问题: 根据你的帖子:qmgr请求amavis的东西,得到一个不明白的回复。我假设qmgr发送邮件给应该检查的amavis。无论是amavis还是邮件都会导致amavis产生腐败的反应。但你怎么检查这个?

最好的方法是停止amavis服务并使用

从控制台启动它
# amavisd debug

然后amavis将输出到控制台。 以下是可能有用的链接:http://www.amavis.org/#faq

然后数据库发出:

根据你的pastebin:dovecot和postfix尝试连接到mysql数据库。 postfix使用带有地址localhost或127.0.0.1的tcp套接字,dovecot使用unix套接字。如果你没有更改mysql端口的配置,那么应该在地址127.0.0.1:3306上有一个监听套接字。 监听地址可能是一个IPv6地址,如:: 1:3306

您可以使用:netstat -ltn

进行验证

如果您使用其他端口,则必须在netstat输出中显示此端口。您可能已将mysql配置为传出的IP地址。然后你会发现类似198.245.60.7:303的内容。在这种情况下,访问127.0.0.1:3306将不起作用。

&#34;后缀&#34;错误消息表示该端口没有监听器或您无法访问。 &#34; dovecot&#34;消息说您没有向mysql服务器提供密码或密码错误,因此它不会对dovecot进行身份验证。请检查配置。