Outgoing Mails from Server are stuck in the Mail Queue Manager (cPanel/WHM), Emails are not delivering from
CloudLinux v8.9.0/AlmaLinux 9 Server!
Here is how to find the problem:
1. View the last few lines of the Exim main log file to quickly check for recent errors or issues
If you want to view the last few lines of the Exim main log file to quickly check for recent errors or issues, you can use the tail command with the -n option to specify the number of lines you want to display. For example, to view the last 20 lines of the Exim main log file, you can use:
# tail -n 20 /var/log/exim_mainlog
This command will display the last 20 lines of the Exim main log file, allowing you to quickly see the most recent entries. If you suspect there might be errors or issues, you can also grep the output to filter for specific keywords. For instance, to search for lines containing the word "error", you can use:
# tail -n 20 /var/log/exim_mainlog | grep error
This will only display the last 20 lines that contain the word "error".
2. Network Connectivity: Verify that your server has proper network connectivity and can reach the destination mail server on port 25. You can use tools like telnet to manually test the connectivity to each IP address:
telnet 3.139.221.6 25
telnet 18.218.159.228 25
telnet 3.143.47.149 25
If the connections fail, it indicates a network issue that needs to be resolved.
3. telnet to test SMTP connectivity:
You can use telnet to test SMTP connectivity to different mail servers from your server to verify if there are any connectivity issues in delivering emails to external recipients. Some common mail servers that you can test connectivity to include:
Yahoo's SMTP server:
# telnet mta6.am0.yahoodns.net 25
Google's SMTP server:
# telnet gmail-smtp-in.l.google.com 25
Microsoft's SMTP server (Outlook/Hotmail):
# telnet mx1.hotmail.com 25
AOL's SMTP server:
# telnet mx-aol.mail.gm0.yahoodns.net 25
Comcast's SMTP server:
# telnet mx1.comcast.net 25
See telnet result: Connected to gmail-smtp-in.l.google.com.
[root@host ~]# telnet gmail-smtp-in.l.google.com 25
Trying 2607:f8b0:4004:c1b::1a...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP vv22-20020a05620a563600b00787fa005857si7962991qkn.178 - gsmtp
By testing SMTP connectivity to various mail servers, you can verify if your server can establish connections and communicate with external email servers, helping you diagnose and troubleshoot any email delivery issues.