The Blog

PLESK

Simple script that can save you from blacklist.

Posted on

This simple php scrips can be run by cron job once an hour to let you know if the qmail queue is getting full.


$x = shell_exec('/usr/local/psa/admin/sbin/mailqueuemng -s');

$y = explode("\n", $x);

foreach($y as $z){
$a = explode(":", $z);
$out[trim($a[0])] = trim($a[1]);
}

if ($out['Messages total'] > 100) {

mail('[email protected]', 'Email Problems', print_r($out, true));
}

Posted in Linux, PHP, PLESK Leave a comment

Plesk email password utilitys

Posted on

To find password for a single email  account

[email protected][#] /usr/local/psa/bin/mail –info [email protected]

To find all email account passwords for a single domain

[email protected][#] /usr/local/psa/admin/bin/mail_auth_view | grep domain.com

The below command will list passwords for all email accounts in plesk.

[email protected][#] /usr/local/psa/admin/bin/mail_auth_view

On older PLESK try

# /usr/local/psa/admin/bin/mail_auth_view

Posted in PLESK Leave a comment

Setting up pflogsumm on CentOS to run nightly on PLESK Postfix

Posted on

Here is a small post on how to setup pflogsumm on your CentOS mail server running Postfix.  It takes advantage of logrorate being called nightly by cron.

1. Install pflogsumm

# yum install postfix-pflogsumm

2. Run a test

# /usr/sbin/pflogsumm /var/log/maillog

3. Update /etc/logrotate.d/syslog.  Add the following:

 prerotate
    pflogsumm /usr/local/psa/var/log/maillog | mail -s "Postfix Log - `date`" [email protected]
 endscript

And little script to send you log hourly if you send over 100 emails per hour.
Make sure to add it to your hourly cron job.

 
#!/bin/sh

hour_now=$(date | awk '{print $2,"", $3, substr($4,0,2)}')
var1=$(grep "$hour_now" /usr/local/psa/var/log/maillog|pflogsumm)
if (( $(echo "$var1" | sed -n '/  delivered$/p' | tr -d '[:alpha:]') > 100 ));
then
echo $var1 | mail -s "Postfix Log - `date`" [email protected]
fi
Posted in PLESK 1 Comment
« Previous PageNext Page »