Postfix very slow sending mail

postfix

How can I turn off the outgoing mails filtering only? My postfix server is very slow. Sending 1 mail/sec, and I think the problem is with the outgoing mail filter (amavis). Or is it possible the problem is something else? The DNS is good.

Best Answer

Check whether amavis is actually being run. I suspect your issue is on the remote end, and you can't turn off filtering at that end.

Draining a queue at 1 mail/sec per thread is probably reasonable. Some of the things which may happen on the other end which will slow down your transfer rate include:

  • DNS lookup of PTR record for your IP address.
  • DNS blacklist lookup(s) of your IP address.
  • DNS whitelist lookup(s) of your IP address.
  • DNS lookup of A record for address returned by PTR for rDNS validation.
  • DNS lookup of SPF for validating your server is permitted to send email.
  • DNS lookup A record for name provided in HELO command. This should be a cached lookup as the name should be the same as that returned by PTR record.
  • DNS loookup of PTR for IP address returned for name in HELO command for rDNS validation. (Again should be cached.)
  • DNS lookup of SPF for name provided in HELO command to ensure it is permitted to send mail as itself.
  • DNS lookup of domain in Envelope Sender address to ensure it is valid.
  • DNS lookup of SPF for validating Envelope Sender is permitted.
  • DNS lookup of DKIM key.
  • Virus scanning the content you send.
  • Spam checking the content you send. This can involve several DNS lookups.

All of these are likely to add up to about a second. Verifying your DNS configuration is complete will help. Configuring both SPF and TXT records for SPF may speed up DNS checks in some cases.

If you can configure Postfix to do immediate delivery, then each message should use its own thread. I don't know if Postfix supports multiple delivery threads. Multiple threads can create synchronization issues which may slow down your server.

High volume delivery may require special tuning of the server software. Exim allows the spool database to be split to allow multiple threads to run with less contention. If the email is not personalized, then putting the addresses in a BCC field and grouping recipients by domain may help.

Related Topic