How to troubleshoot spamming activities on postfix mail server.

Posted: 0p in postfix
Tags:

How to troubleshoot spamming activities on postfix mail server.

1. To see the mail queue:

# mailq

2. To flush the mail queue:

# postfix flush OR

# postfix -f

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 delete all queued messages from or to the domain called spamdomain.com:

# ./postfix-delete.pl spamdomain.com

6. To delete all queued messages that contain the word “abc” in the e-mail address:

# ./postfix-delete.pl abc

7. To know the number of messages sitting in the deferred queue:

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

8. 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
——————————————->

Advertisements
Comments
  1. Matheus says:

    Great tips, thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s