You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Postfix MTA结合Cyrus搭建的SMTP服务器发送速度过慢求助

Troubleshooting Slow Postfix Email Sending (5s per Email) with Cyrus

Hey there, sorry you've been stuck on this for days—5 seconds per email is definitely not normal for Postfix, especially when logs show no obvious errors. Let's walk through some likely culprits you might have missed:

1. Check Postfix Concurrency & Rate Limiting Settings

This is the most common fix for consistent slow sending. Postfix might be configured to send only one email at a time, or have a forced delay between deliveries.

  • First, check your current concurrency limits with:
    postconf | grep -E "(concurrency_limit|rate_delay)"
    
  • Look for parameters like smtp_destination_concurrency_limit (defaults to 1 in some setups) and default_destination_concurrency_limit. If these are set to 1, Postfix will only send one email per destination at a time. Bump these up to a reasonable number (e.g., 10 or 20) in main.cf:
    smtp_destination_concurrency_limit = 10
    default_destination_concurrency_limit = 15
    
  • Also check for smtp_destination_rate_delay or default_destination_rate_delay—if either is set to 5s, that's exactly your issue! Set them to 0 to disable the delay:
    smtp_destination_rate_delay = 0
    default_destination_rate_delay = 0
    
  • After making changes, restart Postfix with systemctl restart postfix (or service postfix restart depending on your distro).

2. Verify DNS Resolution Speed

Even if logs don't show errors, slow DNS lookups for MX records can add per-email delays.

  • Test MX record lookup speed for a destination domain:
    time dig example.com MX
    
    If this takes more than a few hundred milliseconds, your DNS setup is slow. Try using a local DNS cache (like dnsmasq) or switch to a faster public DNS in /etc/resolv.conf.

3. Check for Content Filtering Bottlenecks

If you're using content filters like Amavis, SpamAssassin, or ClamAV, these can slow down email processing if they're under-resourced or misconfigured.

  • Temporarily disable filtering by commenting out the content_filter line in main.cf, then restart Postfix. If sending speed improves, your filter is the bottleneck—check its logs (e.g., /var/log/amavis.log) for delays, or increase its resource limits.

4. DKIM Signature Overhead

If you've enabled DKIM signing, using a large key (like 4096-bit) can add significant processing time per email.

  • Check your DKIM key size in your DKIM configuration (usually in /etc/opendkim/keys/). If it's 4096-bit, generate a 2048-bit key instead—this cuts signing time drastically while still being secure.

5. System Resource Constraints

Insufficient CPU, memory, or disk IO can throttle Postfix:

  • Use top or htop to check if Postfix processes (e.g., qmgr, smtp) are using excessive CPU or memory.
  • Use iotop or iostat to check disk IO on the partition where Postfix stores its queues (usually /var/spool/postfix). High IO wait times mean the disk can't keep up with queue operations.

6. Cyrus Interaction (If Relevant)

Since you're using Cyrus, double-check if Postfix is routing outgoing emails through Cyrus unnecessarily. Outgoing emails should be handled directly by Postfix's SMTP component—verify your main.cf has relayhost set correctly (if you use a relay) and that local delivery is only for internal users.

After trying each step, monitor your sending speed—most of the time, adjusting concurrency or disabling an accidental rate delay fixes this issue. Good luck!

内容的提问来源于stack exchange,提问作者Jiteshp715

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:01:03