Troubleshooting Delivery Issues

Fixing Exim 421 Error: Causes and Solutions

Published · Updated 4 min read
Knowledge base article
Contents (16 sections)

Introduction

The 421 SMTP error is a temporary issue that prevents outgoing emails from being sent. This error usually indicates a temporary failure due to rate limits, server configuration issues, DNS misconfigurations, or incorrect file permissions. Understanding the root causes and applying the correct fixes is essential to ensure smooth email delivery.

This article covers the most common causes of the Exim 421 error and their respective solutions.


Common Causes and Fixes for Exim 421 Errors

1 Mail Server Overload

  • Cause: The mail server is under heavy load and temporarily unable to process new connections.

  • Fix:

    • Restart the mail service:

code
service exim restart # For Exim (cPanel)
systemctl restart postfix # For Postfix
systemctl restart sendmail # For Sendmail
  • Check the server load:

  • code
    uptime
    top

    If the load is high, investigate and reduce it.


    2 SMTP Connection Limit Exceeded

    • Cause: The email provider may have set a limit on the number of outgoing connections or emails per hour.

    • Fix:

      • Check the mail queue:

    code
    exim -bpc # Check Exim mail queue count
  • Increase the maximum connection limit in Exim configuration:

  • code
    nano /etc/exim.conf

    Look for:

    code
    smtp_accept_max = 100

    Increase it if necessary.

  • Restart Exim:

  • code
    service exim restart

    3 IP Address is Blacklisted or Blocked

    • Cause: The sending IP may be blacklisted due to spam reports.

    • Fix:

      • Check if your IP is blacklisted:

    code
    host -t txt <your_ip>.zen.spamhaus.org

    Or use:

  • If blacklisted, request delisting from the blacklist provider.

  • Ensure your PTR record (Reverse DNS) is properly set for your mail server.


  • 4 DNS Issues

    • Cause: Incorrect SPF, DKIM, DMARC, or MX records can lead to SMTP 421 errors.

    • Fix:

      • Check your domain's DNS records:

    code
    dig +short MX domain.com
  • Validate SPF, DKIM, and DMARC using:

  • Ensure proper SPF record:

  • code
    v=spf1 mx a ip4:<server_ip> -all
  • Restart DNS service:

  • code
    systemctl restart named

    5 Firewall (CSF/IPTables) Blocking Port 25/587

    • Cause: CSF or iptables might be blocking outgoing SMTP traffic.

    • Fix:

      • Check firewall rules:

    code
    csf -g <your_server_ip>
    iptables -L -n | grep "25"
  • Allow SMTP ports:

  • code
    csf -a <your_server_ip>
    csf -r

    6 Exim Mail Queue Issues

    • Cause: The mail queue is too large or stuck, causing emails to be rejected with error 421.

    • Fix:

      • Check the mail queue:

    code
    exim -bpc
  • If too many emails are stuck, clear them:

  • code
    exim -bp | exiqgrep -i | xargs exim -Mrm

    7 Email Authentication Issues

    • Cause: If SMTP authentication is not enabled, some mail servers may reject the connection.

    • Fix:

      • Ensure SMTP authentication is enabled in your email client (Thunderbird, Outlook, etc.).

      • In cPanel (Exim):

        • Go to WHM Service Configuration Exim Configuration Manager

        • Ensure Require SMTP Authentication is enabled.


    8 Mail Server Not Listening on Correct Ports

    • Cause: If the mail server isn't properly listening on ports 25, 465, or 587, emails won't go out.

    • Fix:

      • Check listening ports:

    code
    netstat -tlnp | grep -E '25|465|587'
  • If the ports are not open, enable them in:

  • code
    nano /etc/exim.conf

    Ensure:

    code
    daemon_smtp_ports = 25 : 465 : 587
  • Restart Exim:

  • code
    service exim restart

    9 Fixing Ownership Issues in /var/spool/exim/input/

    If /var/spool/exim/input/ has incorrect ownership, Exim may fail to process emails with a 421 error.

    Checking Current Ownership

    code
    namei -l /var/spool/exim/input/

    If it shows mail:mail instead of mailnull:mail, fix it with:

    code
    chown -v mailnull /var/spool/exim/input/

    Then restart Exim:

    code
    service exim restart

    Who is mailnull in Exim

    mailnull is a dedicated system user that Exim uses for handling mail queue processing and email deliveries in many Linux-based mail server configurations.

    • In cPanel & Exim installations, mailnull is the recommended user that Exim should run under for mail queue management.
    • It prevents mail processing from running as root, which is a security risk.

    Why mailnull and Not mail

    • mailnull is a low-privilege user for Exim's operations.
    • Using mail can lead to permission conflicts.
    • cPanel & Exim best practices recommend using mailnull for security and proper mail queue handling.

    Final Steps: Checking Logs

    If the issue persists, check mail logs:

    code
    tail -f /var/log/exim_mainlog
    tail -f /var/log/exim_paniclog

    Conclusion

    The 421 SMTP error in Exim can occur due to overload, firewall blocks, DNS misconfigurations, blacklisting, or incorrect permissions. By checking logs, firewall rules, DNS settings, and Exim configurations, you can quickly diagnose and resolve the issue.

    For additional troubleshooting, always monitor Exim logs and keep your mail server configuration optimized.

    Was this article helpful?

    Your answer helps us decide what to improve next.

    Still need help? Open a support ticket and our team will reply.

    Prefer an app? Add this site to your home screen.Get the app
    Fixing Exim 421 Error: Causes and Solutions - Knowledge Base