• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

qmail-send keeps stopping Plesk 7.5.4 on Debian 3.1

V

viperman67

Guest
We have had major problems on 3 Debian 3.1 servers running Plesk 7.5.4 The qmail-send service keeps stopping at random times throughout the day.

You can still SMTP connect TO the server and deliver inbound, but local and remote queues for outbound delivery fail until the qmail-send service is restarted. This can, of course, be done through control panel.

Since Sunday night our monitoring has logged over 50 times where this service has stopped.

We have disabled watchdog per suggestion, but that has not stopped the problem.

This is costing us in terms of support and customers since the service must be manually restarted each time.

Any suggestions would help.

One thinge we did do was change the nowait to nowait.200 in innet config, but that only seems to have helped a little.

Also, queue size has been anything from 81 to 3000+ messages when service stops/fails

Thanks!
 
We found the same problem in Plesk 7.5.3 and solved it by replacing /usr/bin/qmail_check with the following content:

#!/bin/sh

quit(){
rm -f /var/lock/qmail_cron >/dev/null 2>&1
exit 0
}

checkmsg(){
[ `/var/qmail/bin/qmail-qstat | grep "messages in queue but not yet preprocessed" | sed "s,messages in queue but not yet preprocessed: ,,g"` -lt 1 ] && return 0 || return 1
}

# 1. Check for lock file
if [ -f /var/lock/qmail_cron ]; then
[ `ps -A | grep qmail_check | wc | sed "s,^ *,,g"| sed "s, .*,,g"` -gt 2 ] && exit 0
else
touch /var/lock/qmail_cron
fi

# 2. Check for messages in delivery
checkmsg
if [ $? -eq 0 ]; then
quit
fi

# 3. Stop qmail service
/sbin/service qmail stop >/dev/null 2>&1

# 4. Start qmail service
/sbin/service qmail start >/dev/null 2>&1

# 5. Sleep 30 sec. Check for messages in delivery
while [ 0 -eq 0 ]; do
checkmsg
if [ $? -eq 0 ]; then
quit
fi
sleep 30
done

You can download it here
 
Originally posted by CoKo
We found the same problem in Plesk 7.5.3 and solved it by replacing /usr/bin/qmail_check with the following content:



Thanks, can you explain a bit more what actually is happening?
- Matt
 
It seems SW-Soft configured qmail the following way:

- the smtpd is running as xinetd process
- qmail-send etc. are NOT running by default
- a script is started all 10 (?) minutes to clean the queue

This means all incomming mails are placed in the queue and processed from qmail_check after several minutes. Even local mail gets therefore a delay of up to 10 minutes (and more).

The qmail_check, invoked by cron, checks the queue for unprocessed mails. If needed it starts the qmail service (qmail-send, qmail-respawn etc.) and stops it again after queue processing .


If you need direct delivery of mails and don't want to deal with problems like mails getting processed more then once (which happens from time to time when the service qmail is not started as a service), you need to start the qmail service at server start-up. But this service will be stopped by every run of qmail_check.

By replacing qmail_check with the version I posted we solved the problem and don't need to look after qmail any longer

:cool:
 
Hello,

I've got the same problem but not that script in /usr/bin or other directory.
From crom it seems that nothing calls to anything related to qmail...

Any idea?

Thanks.
 
I believe there have been several threads addressing the Plesk use of Qmail on Debian systems, when running under inetd/xinetd there is a known problem (not due to Plesk), the suggested resolution is to switch to running Qmail under tcpserver. Other references to this issue can be found by Googling "debian qmail inetd"
 
I have linux server and this problem happened to me many times,, can you tell me where and how should I put this script ya CoKo as I am using SSH client.
I am just new with the servers and no one help me in that!
Thanks
 
Hi Mitch,

mind to tell us a bit about your configuration (OS, Plesk version)?
 
ohh thanks so much for your reply, finally there is a hope for my problem

here is my config
Version: psa v7.5.4_build75050926.17 os_RedHat el3
OS: Linux 2.4.21-4.ELsmp
Plesk 7.5.4
psa-qmail: 1.03-rhel3.build75050824.12

Is there any information you need more??

Best Regards
 
Hi Mitch,

ok, let us do it step by step.

If anyone of the following steps is NOT working or throws an error message - please stop immediately and post the message.

- SSH to the server as user root
- ls -al /usr/bin/qmail_check

You should see a file there. If NOT, stop here.

- cd /usr/bin
- mv qmail_check qmail_check.old
- wget http://www.coko.de/qmail_check
- service qmail restart

done
 
ok I login into the SSH client PUTTY
and I wrot ethe following
/usr/bin/qmail_check

the answer back was

-bash: /usr/bin/qmail_check: No such file or directory


Whats should I do now?
Thanks
 
cat /etc/crontab
cat /var/spool/cron/root

Hope that tells us the name of the script...
 
On some (VPSs) the script name will be a0dummy or a1dummy (IIRC)

Although I do not remember any reports of this on Debian, there have been a number of posts recently regarding Qmail and Debian, related to Qmail stopping for no apparent reason, this has been attributed to running qmail under inetd/xinetd, and it is recommended to switch to using tcpserver for qmail on debian.
 
[root@welcometours root]# /usr/bin/qmail_check
-bash: /usr/bin/qmail_check: No such file or directory

[root@welcometours root]# al/usr/bin/qmail_check
-bash: al/usr/bin/qmail_check: No such file or directory

[root@welcometours root]# cat/etc/crontab
-bash: cat/etc/crontab: No such file or directory

[root@welcometours root]# cat/var/spoot/cron/root
-bash: cat/var/spoot/cron/root: No such file or directory

Sorry that I am slow in that , as I said I just new with all of this

I did wrote this to the SSH

[root@welcometours root]# /etc/crontab
-bash: /etc/crontab: Permission denied
[
root@welcometours root]# /var/spool/cron/root
-bash: /var/spool/cron/root: Permission denied
 
Code:
[b][root@welcometours root]# ls  -al  /usr/bin/qmail_check

[root@welcometours root]# cat  /etc/crontab

[root@welcometours root]# cat  /var/spool/cron/root[/b]
Notice the ls -al ... and the space after 'cat'

Edit: Mitch had a misspelling, and I blindly copied/pasted it. The word 'spool' was misspelled.

I think I know what CoKo is trying to get at, and I would rather you do the following command:
Code:
[root@welcometours root]# crontab -l
(That is a lowercase L)
 
Well something appears here ;)

[root@welcometours root]# Is -al /usr/bin/qmail_check
-bash: Is: command not found

[root@welcometours root]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

[root@welcometours root]# cat /var/spoot/cron/root
cat: /var/spoot/cron/root: No such file or directory
 
@ShadowMan: crontab -l does not always show the contents of /etc/crontab. That was the reason I asked to cat the files.

About hte other command:

ls -al /usr/bin/qmail_check

I write it now in big letters, because I think Mitch did some typos here too:

LS -AL /USR/BIN/QMAIL_CHECK

@mitch: please type the above in SMALL letters
 
[root@welcometours root]# cat /var/spool/cron/root
[email protected]
14 5 * * * /usr/local/psa/bin/mysqldump.sh >/dev/null 2>&1
7 4 * * * /usr/local/psa/admin/sbin/statistics >/dev/null 2>&1
*/15 * * * * /usr/local/psa/admin/sbin/backupmng >/dev/null 2>&1
17 7 * * * /usr/local/psa/admin/bin/php /usr/local/psa/admin/plib/report/autoreport.php --auto daily >/dev/null 2>&1
17 7 * * 1 /usr/local/psa/admin/bin/php /usr/local/psa/admin/plib/report/autoreport.php --auto weekly >/dev/null 2>&1
17 7 1 * * /usr/local/psa/admin/bin/php /usr/local/psa/admin/plib/report/autoreport.php --auto monthly >/dev/null 2>&1
[

root@welcometours root]# crontab -1
crontab: invalid option -- 1
crontab: usage error: unrecognized option
usage: crontab [-u user] file
crontab [-u user] { -e | -l | -r }
(default operation is replace, per 1003.2)
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)

Ok and sorry about that too but I think I write righ this time

[root@welcometours root]# ls -al /usr/bin/qmail_check
ls: /usr/bin/qmail_check: No such file or directory
 
ok. Seems on your server there is no qmail_check program confusing the qmail - as it seems there are different releases of Plesk 7.5.4...

I would advice to follow ShadowMans suggestion of switching your qmail to use tcpserver
 
Back
Top