• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Monitor Email queue

Epiphany

New Pleskian
How can I configure an event so when the number of emails in the queue exceeds a certain number then I am notified on the Mobile Plesk Server Monitor?

Thanks,
Mark
 
Thank you for the suggestion but that does not provide a solution. Manually writing the query for number of emails is only part of the answer.
 
Hi Epiphany,

why do you want to monitor the queue? Do you have huge consumption in it? Then you should try to reduce it, better than monitoring the queue.
 
I have on average < 100 emails in the queue. If a spammer gets into the server then the number of emails in the queue is over 5,000. I want to be notified if the number of emails is > a specified limit.
 
Hi Epiphany,

that will be a little bit more complicated. If you mean a spammer as a customer, that it'll hard to discover. But if you mean some ppl, which hacked your server or open relay, I'd say, that you install fail2ban on it.
 
I don't know how to get notified on the Mobile Plesk Server Monitor, but I've created a simple script on our server that checks email queue, if number exceed XX number, I get email about the same.

Please note that you will get email only if email queue exceed XX number, otherwise you won't get spammed.

Here it is:
- simply create new .sh file, for example in your home folder
# nano /home/user/check_email_queue.sh

Content of file "check_email_queue.sh" is:
#!/bin/bash

# get server hostname
hostname=`cat /etc/hostname`

current_mailq=`postqueue -p | tail -n 1 | cut -d' ' -f5`

yourEmail="YOUR_EMAIL_HERE"


if [ "$current_mailq" -gt "100" ]
then
echo "Mail queue problem - there is currently $current_mailq mails in queue. Please check it out." > check_email_queue_outgoing.txt
mail -s "$hostname - mail queue alert - there are $current_mailq emails in queue" "$yourEmail" < check_email_queue_outgoing.txt
else
echo "Mail queue is fine - there is currently $current_mailq mails in queue. Please check it out."
echo "Do nothing, situation is fine."
fi

- check and change BOLD number that will suit your needs (if queue mail number is bigger then this number, you get email)
- set 744 permission to that file and schedule it as a cronjob:
*/5 * * * * cd /home/user/ && ./check_email_queue.sh

If you have currently e.g. 10 emails in queue, set the number to 5 and run the script - check if you get the email.

Good luck.
 
Back
Top