1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

qmail-send keeps stopping Plesk 7.5.4 on Debian 3.1

Discussion in 'Plesk for Linux - 8.x and Older' started by viperman67, Oct 25, 2005.

  1. viperman67

    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

  2. CoKo

    CoKo Guest

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


    rm -f /var/lock/qmail_cron >/dev/null 2>&1
    exit 0

    [ `/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
    touch /var/lock/qmail_cron

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

    # 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
    if [ $? -eq 0 ]; then
    sleep 30

    You can download it here
  3. viperman67

    viperman67 Guest


    Thanks, can you explain a bit more what actually is happening?
    - Matt
  4. CoKo

    CoKo Guest

    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

  5. split

    split Guest


    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?

  6. ShadowMan@

    ShadowMan@ Guest

    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"
  7. Mitch@

    Mitch@ Guest

    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!
  8. CoKo

    CoKo Guest

    Hi Mitch,

    mind to tell us a bit about your configuration (OS, Plesk version)?
  9. Mitch@

    Mitch@ Guest

    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
  10. CoKo

    CoKo Guest

    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

  11. Mitch@

    Mitch@ Guest

    ok I login into the SSH client PUTTY
    and I wrot ethe following

    the answer back was

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

    Whats should I do now?
  12. CoKo

    CoKo Guest

    cat /etc/crontab
    cat /var/spool/cron/root

    Hope that tells us the name of the script...
  13. ShadowMan@

    ShadowMan@ Guest

    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.
  14. Mitch@

    Mitch@ Guest

    [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
  15. ShadowMan@

    ShadowMan@ Guest

    [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:
    [root@welcometours root]# crontab -l
    (That is a lowercase L)
  16. Mitch@

    Mitch@ Guest

    Well something appears here ;)

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

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

    # 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
  17. ShadowMan@

    ShadowMan@ Guest

    Please see my edited post above...
  18. CoKo

    CoKo Guest

    @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:


    @mitch: please type the above in SMALL letters
  19. Mitch@

    Mitch@ Guest

    [root@welcometours root]# cat /var/spool/cron/root
    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
  20. CoKo

    CoKo Guest

    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