Skip to content

Monitors Postfix queue and performs emergency shutdown in case of spam attacks.

License

Notifications You must be signed in to change notification settings

1connect/mailq-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postfix queue monitor

If you host several Wordpress websites, there's a great deal of possibility that one of them might be compromised and become a SPAM sender. SPAM is usually rejected by the recipients so queue gets longer and longer. The script checks the length of Postfix queue and performs appropriate actions depending on the queue length.

It'll help you protecting your server from becoming SPAM sender and getting blacklisted in consequence.

There are two levels defined:

  • warning - if mail queue is longer than warning value, the script prints warning to stdout since the script should be called from cron, the output is sent to root

  • shutdown - if queue is longer than specified shutdown parameter, Postfix is shut downand SMS message is sent

Installation

  • Install required packages:
apt-get install python3-plumbum
  • Clone repository and edit config file:
git clone https://github.com/1connect/mailq-monitor.git
cd mailq-monitor
cp example.config.ini config.ini
  • Add the following line to crontab (using crontab -e):
* * * * * /root/mailq-monitor/mailq_check.py

Testing

To check SMS configuration, you can run:

./mailq_check.py --test-sms

About

Monitors Postfix queue and performs emergency shutdown in case of spam attacks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages