Skip to content
  • About
  • Contact
  • Docs
  • Features
  • Home

Configurations

5
  • Setup RAID Level 6
  • Setup RAID Level 5
  • How To Add Swap on RHEL or Centos based system
  • Website Migration to Non-Panel OpenLiteSpeed Server
  • Linux Server Performance Tuning

CyberPanel

9
  • Mounting /tmp on a Separate File
  • Updating CyberPanel Main VirtualHost Configuration
  • Updating CyberPanel vHosts Configuration
  • How to Change CLI PHP on CyberPanel
  • How to Update PHP Version to 8.1 in CyberPanel (From 7.3, 7.4, or 8.0)
  • CyberPanel Server Cleanup: Logs, Dumps, Backups
  • CyberPanel Full LSPHP Installation PHP 7.4 – 8.3
  • CyberPanel / OpenLiteSpeed: Clean LSPHP Session Files
  • SSL Certificate Management in CyberPanel via SSH

Hestia Control Panel

6
  • Fixing Email Bounce Back Issue in Hestia (Exim4 Blacklist Rejection)
  • Managing Fail2Ban in HestiaCP Server
  • Installing and Configuring PHP Versions in HestiaCP
  • phpMyAdmin Not Found in HestiaCP
  • Setting Up a Reverse Proxy for any Port in HestiaCP
  • How to Install Let’s Encrypt SSL in Hestia CP (Hostname, Admin Panel, and Email Server)

WHM/cPanel

6
  • Setting Up a Reverse Proxy on cPanel/WHM for Port 8081
  • How to increase the size of the cPanel-generated /tmp filesystem
  • Installing Old PHP Versions on a cPanel/WHM Server
  • Fixing “550: Your Country is Not Allowed to Connect to This Server” Error in Exim (cPanel)
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Securing /tmp and /var/tmp with a Dedicated Loopback Filesystem

Nagios

5
  • Service Checks
  • Uptime Checks
  • Disk Space Checks
  • Load Checks
  • Email Related Checks

WordPress

3
  • WordPress Core Reinstallation Guide
  • Managing WordPress Users via WP-CLI
  • Website Duplication, Migration, or Domain Change

Operating System

1
  • Server Reboot (RHEL or Centos based system)

AWS

1
  • How to Resize EBS Volumes on AWS

Databases

2
  • MySQL
    • Optimizing MySQL Performance
    • Recovering MySQL in Plesk When InnoDB Crashes

CloudLinux

4
  • Moving cagefs-skeleton directory
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Enable bc in CageFS on CloudLinux Servers(WHM/cPanel)
  • How to Upgrade MySQL 5.x to MySQL 8.0 on CloudLinux (WHM server) with MySQL Governor

Cloudflare

1
  • Configuring Security Headers in Cloudflare

ISPmanager

1
  • Install Free SSL (Let’s Encrypt) for domain.tld on ISPmanager with NGINX

Plesk

1
  • Plesk Admin Login Blocked – IP Restriction Recovery Guide

VPN

4
  • Install OpenVPN Open Source in Linux CentOS Ubuntu Debian Servers
  • Protected: OpenVPN Installation & Fix Wiki (CloudLinux / CentOS 7 & 8)
  • Outline VPN Installation & Management Guide
  • Installing AdGuard Home on Debian/Ubuntu (Docker)
View Categories
  • Home
  • Docs
  • Nagios
  • Email Related Checks

Email Related Checks

### check_mailqueue
Command:

/usr/local/nagios/libexec/check_nrpe -H localhost -c check_mailqueue

This checks the email queue status.

—

### Exim Commands for Mail Queue

– **Check Mail Count**:

“`
exim -bpc
“`

This command shows the total count of emails in the queue.

– **View Mail List**:

“`
exim -bp
“`

This displays the list of all emails in the queue.

– **View Mail Header**:

“`
exim -Mvh <mailID>
“`

Displays the header of a specific email.

– **View Mail Body**:

“`
exim -Mvb <mailID>
“`

Displays the body of a specific email.

– **Force Full Email Send**:

“`
exim -qff -v -C /etc/exim.conf
“`

Forces the delivery of all queued emails.

– **Delete Frozen Messages**:

“`
exim -bp | grep frozen | awk {‘print $3’} | xargs exim -Mrm
“`

– **Delete “fbpm” Messages**:

“`
exim -bp | grep “fbpm” | awk {‘print $3’} | xargs exim -Mrm
“`

– **Delete Emails of Specific Users**:

“`
exim -bp | grep “username” | awk {‘print $3’} | xargs exim -Mrm
“`

– **Delete All Emails from Queue**:

“`
exim -bp | awk ‘/^ *[0-9]+[mhd]/{print “exim -Mrm ” $3}’ | bash
“`

– **Search Mail Log for Specific Mail ID**:

“`
exigrep <mailID> /var/log/exim_mainlog
“`

– **Get Email Subject from Log**:

“`
grep -oP ‘T=\K”[^”]+”‘ /var/log/exim_mainlog
“`

– **Exclude Specific Subject in Log**:

“`
grep ‘ <= ‘ /var/log/exim_mainlog | grep -v ‘Web server cp1.superior-host.com on cp1.superior-host.com\\n automatically restarted’ | grep -oP ‘T=\K”[^”]+”‘
“`

– **Remove All Emails from Queue**:

“`
exim -bp | awk ‘{print $3}’ | sed ‘s/[<>]//g’ | xargs -I {} exim -Mrm {}
“`

—

### check_postqueue

– **Check Mail Count in Postfix**:

“`
postqueue -p | grep -c “^[A-Z0-9]”
“`

– **View Mail Queue**:

“`
postqueue -p
“`

– **View Postfix Mail Header and Body**:

“`
postcat -q <ID>
“`

– **Delete Frozen Emails in Postfix**:

“`
postsuper -d ALL deferred
“`

– **Force Full Email Send in Postfix**:

“`
postsuper -r ALL && postqueue -f
“`

– **Remove Specific Mail from Postfix Queue**:

“`
postqueue -p | awk ‘BEGIN { RS = “” } /[email protected]/ { print $1 }’ | postsuper -d –
“`

—

### check_mailcount_hour
Command:

“`
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_mailcount_hour
“`

This checks the mail count for the last hour.

– **Search for Specific Mail ID in Exim Log**:

“`
grep ***mail_id*** /var/log/exim_mainlog
“`

– **Find Specific User’s Mails**:

“`
tail -f /var/log/exim_mainlog | grep username
“`

– **Check if Mails are Sent via Scripts**:

“`
grep -i post /usr/local/apache/domlogs/stainbus/* | cut -d ” ” -f7 | sort | uniq -c | sort -n
“`

– **Check Mails from Contact Forms**:

“`
cat /usr/local/apache/domlogs/USERNAME/* | grep CONTACTFORM_NAME
“`

– **Check for Scripts Sending Spam Mails**:

“`
awk ‘$3 ~ /^cwd/{print $3}’ /var/log/exim_mainlog | sort | uniq -c | sed “s|^ *||g” | sort -nr
“`

—

### Exim Mail Sender Details

– **Get Sorted List of Mail Senders**:

“`
exim -bpr | grep “<” | awk {‘print $4’} | cut -d “<” -f 2 | cut -d “>” -f 1 | sort -n | uniq -c | sort -n
“`

– **Get Mail Information by User**:

“`
csf -g IP
“`

“`
cat /var/log/maillog | grep usermail
“`

“`
tail -f /var/log/maillog | grep emailid
“`

—

### check_dovecotcon

– **View Dovecot Connection Logs**:

“`
exim -bp ID
exim -Mvh ID
exim -Mvb ID
“`

– **Search for Specific Mail ID in Logs**:

“`
grep ****mailid**** /var/log/maillog
grep ***id*** /var/log/exim_mainlog
“`

– **Clear Log by Tar if Mails Are Genuine**.

– **Change Password if Dovecot Logins Are High**.

—

# Notes

– Always verify mails in the queue before deleting.
– Use `tail -f` to monitor real-time logs.
– Take necessary actions based on the type of issue, such as spam detection or genuine email delivery issues.

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest

Was it helpful ?

  • Happy
  • Normal
  • Sad
  • About
  • Contact
  • Docs
  • Features
  • Home

© 2026 Panel Web Hosting

  • About
  • Contact
  • Docs
  • Features
  • Home