Domain-Name-System

非常慢的 smtp 伺服器響應

  • October 25, 2015

我最近在https://www.scaleway.com/上創建了一個伺服器。伺服器的作業系統是 Fedora22。我安裝了一個 SMTP 伺服器(後綴)。它工作正常,但我的反應很慢。我從 php 腳本或 ruby​​ redmine 發送的任何消息都會使頁面載入時間很長。當我嘗試發送這樣的消息時:

echo "TEXT" | mail -s "Hello world" mail@gmail.com

我在 1 或 2 分鐘內收到了這條消息。

來自 postfix status 命令的日誌:

● postfix.service - Postfix Mail Transport Agent
  Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
  Active: active (running) since Sun 2015-10-25 14:04:52 EDT; 2min 1s ago
 Process: 1448 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS)
 Process: 1467 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
 Process: 1464 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
 Process: 1459 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Main PID: 1537 (master)
  CGroup: /system.slice/postfix.service
          ├─1537 /usr/libexec/postfix/master -w
          ├─1538 pickup -l -t unix -u
          ├─1539 qmgr -l -t unix -u
          ├─1605 smtpd -n smtp -t inet -u -o stress=
          ├─1606 proxymap -t unix -u
          ├─1607 trivial-rewrite -n rewrite -t unix -u
          ├─1608 cleanup -z -t unix -u
          └─1609 smtp -t unix -u

Oct 25 14:04:51 scw-5a11dd postfix/postfix-script[1535]: starting the Postfix mail system
Oct 25 14:04:51 scw-5a11dd postfix/master[1537]: daemon started -- version 3.0.2, configuration /etc/postfix
Oct 25 14:04:52 scw-5a11dd systemd[1]: Started Postfix Mail Transport Agent.
Oct 25 14:06:08 scw-5a11dd postfix/smtpd[1605]: connect from localhost.localdomain[127.0.0.1]
Oct 25 14:06:08 scw-5a11dd postfix/smtpd[1605]: E16B941726: client=localhost.localdomain[127.0.0.1]
Oct 25 14:06:08 scw-5a11dd postfix/cleanup[1608]: E16B941726: message-id=<201510251806.t9PI68aj001554@scw-5a11dd>
Oct 25 14:06:08 scw-5a11dd postfix/qmgr[1539]: E16B941726: from=<root@scw-5a11dd>, size=682, nrcpt=1 (queue active)
Oct 25 14:06:08 scw-5a11dd postfix/smtpd[1605]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Oct 25 14:06:09 scw-5a11dd postfix/smtp[1609]: E16B941726: to=<wkyborgw@gmail.com>, relay=gmail-smtp-in.l.google.com[64.233.166.26]:25, del...- gsmtp)
Oct 25 14:06:09 scw-5a11dd postfix/qmgr[1539]: E16B941726: removed

我不知道該怎麼辦。提前感謝您的幫助!

在沒有看到您的 Postfix 配置的情況下,可以確定這是問題所在。但是檢查後綴文件 -

http://www.postfix.org/smtpd.8.html

並查找 TarPit 設置。查看您的配置 smtpd_error_sleep_time 是否設置為 2 分鐘。

引用自:https://serverfault.com/questions/731561