for i in $(postqueue -p | grep -o -w -E '^[[:alnum:]]{11}'); do postcat -q $i | egrep '(Executable|Command)'; done Find originating scripts: for i in $(postqueue -p | egrep -o -w '^[[:alnum:]]{10}'); do postcat -q $i | grep 'X-PHP-Originating-Script'; done | cut -d':' -f1- | sort -b|uniq -c|sort -rnk1 for i in $(postqueue -p | grep '^[0-9A-Z]'| awk '{print $1}'); do postcat -q $i | grep 'X-PHP-Originating-Script'; done | cut -d':' -f1- | sort -b|uniq -c|sort -rnk1 find 0/ -type f -exec grep -Ea -o Script\:\ [[:digit:]]+\:[[:alnum:]]+\.php {} \;|sort|uniq -c|sort -rnk1 Finding the size of the queue: postqueue -p | grep -c '^[0-9A-Z]' Check the file structure if the above command is taking too long: ll /var/spool/postfix/active | wc -l function _line { echo "=======Emails in $DIR Queue======="; };cd /var/spool/postfix;ls -l|egrep -o "deferred|hold|active|corrupt|defer|maildrop"|while read DIR; do _line; ls -lA $DIR|wc -l; echo; done;cd - 1>/dev/null; egrep -o "\/var\/www\/vhosts[^:]*" /var/log/php_maillog|sort|uniq -c|sort -rnk1|head Print the messages in the queue with the UID: postqueue -p Print the email message in the terminal: postcat -q $UID !!Clearing the queue!! for i in $(postqueue -p | grep -o -w -E '^[[:alnum:]]{10}'); do postsuper -d $i; done Forwarder location: /var/qmail/mailnames/domain.tld/emailaddress/.qmail Send email from command line: echo -e "To:username@example.com \nSubject: Test mail from web\n\n Test mail from web via sendmail\n" | sendmail -t -F root@web.domain.com "deferred - Mail that could not be delivered upon the first attempt. The queue manager implements exponential backoff by doubling the time between delivery attempts." "defer - Per-recipient status information about why mail is delayed. These files are maintained by the defer(8) daemon."