how we can Postfix Spamming Check

We can use different commands to check the mail activities on a postfix mail server. Some examples provided below:

1. To check the mail queue:

# mailq

To get the number of mails in the queue:
# mailq | wc -l

2. To flush the mail queue:

# postfix -f
# postfix flush  OR

3. To remove all mails from the queue:

# postsuper -d ALL

4. To remove all mails in the deferred queue:

# postsuper -d ALL deferred

5. To know the number of messages there in the deferred queue:

# find /var/spool/postfix/deferred -type f | wc -l

6. To get a sorted list of the accounts that have the most mail in the queue. This usually means a maximum of 2 or 3 spammers at the end of the list:

# mailq|grep ^[A-F0-9]|cut -c 42-80|sort |uniq -c|sort -n|tail

7. Check which script is sending spam:

postcat -q <ID>
You can get the message ID from mailq command.

Usually, it will show the script which contains "X-PHP-Originating-Script". Check and identify the line which starts with "X-PHP-Originating-Script" and you can remove the script file as well since it will show the path as well. 

  • postfix flush queue
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

DDOS and DNS A Records Need Why ?

It is required that all DDOS shared hosting clients use Rivalhost Global Protected Name-servers...

Can you change my PHP version?

All new shared hosting accounts are created on a server which runs php version 5.3.x or higher We...

Do you host adult sites or content?

Yes we have Offshore Server also Offshore/ anonymous location . you can host / or runs any type...

Can I have multiple domains point to the same website?

Yes. These are commonly referred to as "parked domains" and allow you to have multiple domain...

How long does it take for my account to be setup?

Generally, it will not take more than 24 hours for us to setup your account, unless we have...