我的邮件服务器花了很长时间来发送邮件,从我的邮件日志中,我发现延迟值很高。 请指导我如何缩短队列pipe理器之前的时间。 谢谢。
Jun 26 01:11:21 host postfix/smtpd[20826]: 3CEA53000CC631: client=localhost[127.0.0.1], sasl_method=LOGIN, sasl_username=abc Jun 26 01:11:21 host postfix/cleanup[20831]: 3CEA53000CC631: message-id=<[email protected]> Jun 26 01:14:28 host postfix/qmgr[13870]: 3CEA53000CC631: from=<[email protected]>, size=5929654, nrcpt=1 (queue active) Jun 26 01:14:28 host postfix/pipe[21037]: 3CEA53000CC631: to=<[email protected]>, relay=dfilt, delay=191, delays=191/0.01/0/0.15, dsn=2.0.0, status=sent (delivered via dfilt service) Jun 26 01:14:28 host postfix/qmgr[13870]: 3CEA53000CC631: removed Jun 26 01:19:30 host postfix/pickup[13869]: 22B883000CC637: uid=384 from=<[email protected]> Jun 26 01:19:30 host postfix/cleanup[20831]: 22B883000CC637: message-id=<[email protected]> Jun 26 01:19:38 host postfix/qmgr[13870]: 22B883000CC637: from=<[email protected]>, size=3926, nrcpt=1 (queue active) Jun 26 01:19:40 host postfix/smtpd[20773]: connect from gateway[192.168.0.18] Jun 26 01:19:41 host postfix/smtp[21607]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4002:c06::1b]:25: Network is unreachable Jun 26 01:19:42 host postfix/smtp[21607]: 22B883000CC637: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.21.27]:25, delay=230, delays=226/0.01/3.2/0.55, dsn=2.0.0, status=sent (250 2.0.0 OK 1498411182 z187si2453601ybb.86 - gsmtp) Jun 26 01:19:42 host postfix/qmgr[13870]: 22B883000CC637: removed
这是我的后缀configuration:
queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix myhostname = mail.example.com mydomain = example.com myorigin = $mydomain inet_interfaces = all inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain local_recipient_maps = unix:passwd.byname $alias_maps unknown_local_recipient_reject_code = 550 mynetworks_style = host relayhost = alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases home_mailbox = Maildir/ mailbox_command = procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir header_checks = regexp:/etc/postfix/header_checks mime_header_checks = regexp:/etc/postfix/mime_header_checks.regexp body_checks = regexp:/etc/postfix/mbl-body-deny 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.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.10.1/samples readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES smtpd_delay_reject = yes disable_vrfy_command = yes strict_rfc821_envelopes = yes invalid_hostname_reject_code = 554 multi_recipient_bounce_reject_code = 554 non_fqdn_reject_code = 554 relay_domains_reject_code = 554 unknown_address_reject_code = 554 unknown_client_reject_code = 554 unknown_hostname_reject_code = 554 unknown_local_recipient_reject_code = 554 unknown_relay_recipient_reject_code = 554 unknown_sender_reject_code = 554 unknown_virtual_alias_reject_code = 554 unknown_virtual_mailbox_reject_code = 554 unverified_recipient_reject_code = 554 unverified_sender_reject_code = 554 empty_address_recipient = MAILER-DAEMON message_size_limit = 15000000 mailbox_size_limit = 620000000 local_transport = local notify_classes = 2bounce,resource,software bounce_notice_recipient = postmaster default_process_limit = 200 queue_run_delay = 600s delay_warning_time = 12h smtpd_banner = dolphineng.com ESMTP smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_authenticated_header = yes smtpd_soft_error_limit = 3 smtpd_hard_error_limit = 6 smtpd_use_tls = yes smtpd_tls_key_file = /etc/ssl/certs/mailserverreq.pem smtpd_tls_cert_file = /etc/ssl/certs/mailserver.pem smtpd_tls_loglevel = 3 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom virtual_alias_maps = hash:/etc/postfix/virtual smtpd_sender_login_maps = pcre:/etc/postfix/login_maps.pcre smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain, reject_sender_login_mismatch, reject_unlisted_sender, check_sender_access hash:/etc/postfix/access, permit smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unknown_address, reject_unlisted_recipient, reject_invalid_hostname, reject_non_fqdn_recipient, check_recipient_access pcre:/etc/postfix/recipient_checks.pcre, check_sender_access hash:/etc/postfix/access, reject_unknown_recipient_domain, reject_unknown_sender_domain, check_client_access pcre:/etc/postfix/fqrdns.pcre reject_sender_login_mismatch, reject_non_fqdn_sender, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.sorbs.net, reject_rbl_client psbl.surriel.com, reject_rbl_client b.barracudacentral.org, permit smtpd_data_restrictions = reject_unauth_pipelining, permit sender_bcc_maps = hash:/etc/postfix/sender_bcc_maps recipient_bcc_maps = hash:/etc/postfix/recipient_bcc_maps smtpd_restriction_classes = local_only local_only = check_recipient_access hash:/etc/postfix/local_domain, reject virtual_transport = dovecot dovecot_destination_recipient_limit = 1 smtp_data_xfer_timeout = 600s
首先,我们来排练delays=值是什么意思(从delay_logging_resolution_limit ):
delays=a/b/c/d日志的格式如下:
- a =从消息到达到最后一个活动队列条目的时间
- b =从最后一个活动队列input到连接build立的时间
- c =连接设置的时间,包括DNS,EHLO和STARTTLS
- d =消息传输的时间
在您的示例中,只有a增加,意味着从SASLauthentication的客户端连接期间出现延迟。 消息从客户端到达后的一切都发生得很快。 这可以导致这样的结论:问题可能不在服务器configuration中,而是在客户端连接中。
日志中的示例包含两个单独消息的传递。
以3CEA53000CC631开头的3CEA53000CC631 : delays=191/0.01/0/0.15 , size=5929654
在这里,消息大小可能是原因。 上传速度似乎在31 kBps左右,如果还有其他内容同时上传,这对客户DSL来说似乎是合理的。
以22B883000CC637开头的22B883000CC637 : delays=226/0.01/3.2/0.55 , size=3926
由于现在的规模已经大大降低了,所以我们不能单单把责任归咎于上传带宽。
我们可以看到,即使当消息首先尝试传递失败的IPv6连接时[2607:f8b0:4002:c06::1b]:25: Network is unreachable ,然后在IPv4上再次成功,延迟c只增加3秒。 您应该修复或禁用您的IPv6连接,但这不是延迟的主要原因。
有关进一步调查,请参阅邮件用户代理 MUA连接期间发生的情况