Tag Archives: ispconfig

Postfix/amavis workaround: “delivery temporarily suspended”

I’ve put together a quick workaround for a long-standing problem with my server, whereby every so often my mailserver will crash (usually every week or so). I discovered the problem relates to amavis crashing – but as yet I have not found a solution to the problem.

The shell script I’ve put together below (with the help of this) checks the status of the amavis service. If it’s down, the script will bring it back up and then restart postfix to resume deliveries.

I’d suggest running the script every 5 minutes from a cron job (use crontab -e to modify to your cron jobs).

#!/bin/bash
#
# Author: Alex Ward
# This script was created to find workaround to a problem where postfix would fail
# if amavis stopped on ISPConfig / Debian. This simple script will check the
# uptime of amavis and, if it is down, start it and then restart postfix.
# This script can be set up in a crontab.
#
# Built with help from
# http://www.akamaras.com/linux/linux-script-to-check-if-a-service-is-running-and-start-it-if-its-stopped/
#
#
version=”1.1″
#Changelog: Implemented version number and prepared for crontab logging.

service=amavis

echo ‘==========================’
echo ‘MAILSERVER SYSTEM CHECKUP!’
echo ‘==========================’
echo ”
date
echo “Version: $version”
echo ”
echo “Checking $service status…”
if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 ))
then
echo “$service is running! No action required.”
else
echo “$service is DOWN! Rectifying this…”
/etc/init.d/$service start
postfix stop
postfix start
fi

echo ”
echo ‘=====================================================================’
echo ”
#END

You can download a copy of the script here (right click, save as).

It isn’t a solution to the problem – but until I find the solution, this will at least stop the problem from killing off mail deliveries.

Configuring anti-spam (SpamAssassin) in ISPConfig 3

As you may have noticed, I’ve recently moved GEEK! to a brand new VPS – which, hopefully, will massively improve the uptime and performance of the site in the long run. It’s a little too early to tell, but now most of the trial bugs are ironed out, improvements should start to be seen soon.

However, by moving my site (and all other sites I run) to a VPS, I have had to make some sacrifices. The key sacrifice on my end has been cPanel – which I’ve used ever since I started working with web servers. I love cPanel – it’s generally very reliable and controls most of the functions I would ever want. But now, as I’m slowly getting more experienced with the way web servers work, I thought it would be a good time to move on to something a little more advanced (and, as a result, cheaper). I was recommended to ISPConfig – a free and open source control panel for web servers running on Linux. And after a slow start, I seem to be getting the hang of it.

The one thing that really did get to me for a while was the poor performance of the spam filter built into ISPConfig. ISPConfig relies on SpamAssassin – which is, when configured correctly, a very powerful spam filter. But for some reason, it just wasn’t working on my installation of ISPConfig. Spam would get through and it can get seriously frustrating!

Thankfully I now have it cracked – and wanted to share the configuration I chose for ISPConfig and SpamAssassin. I think the correct settings vary from person to person – but if you want general spam filtering, this should show you how to get it.

Continue reading