Qmail Installation


Recommended Posts

I am installing qmail. I copied qmailctl.txt file that i downloaded from some site, I copied it to /var/qmail/bin/qmailctl I chmod 755 the file, I made symlink in /usr/bin/. I try to run it and it says:

Bad interpreter: No such file or directory

/var is on patition with defaults 1 2 in its fstab entry

other scripts in /var/qmail/bin run properly

Can somebody help!!!!!!!!!!!

here is the script

--------------------------------------------------------------------

#!/bin/sh

# description: the qmail MTA

PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin

export PATH

QMAILDUID=`id -u qmaild`

NOFILESGID=`id -g qmaild`

case "$1" in

start)

echo "Starting qmail"

if svok /service/qmail-send ; then

svc -u /service/qmail-send /service/qmail-send/log

else

echo "qmail-send supervise not running"

fi

if svok /service/qmail-smtpd ; then

svc -u /service/qmail-smtpd /service/qmail-smtpd/log

else

echo "qmail-smtpd supervise not running"

fi

if [ -d /var/lock/subsys ]; then

touch /var/lock/subsys/qmail

fi

;;

stop)

echo "Stopping qmail..."

echo " qmail-smtpd"

svc -d /service/qmail-smtpd /service/qmail-smtpd/log

echo " qmail-send"

svc -d /service/qmail-send /service/qmail-send/log

if [ -f /var/lock/subsys/qmail ]; then

rm /var/lock/subsys/qmail

fi

;;

stat)

svstat /service/qmail-send

svstat /service/qmail-send/log

svstat /service/qmail-smtpd

svstat /service/qmail-smtpd/log

qmail-qstat

;;

doqueue|alrm|flush)

echo "Flushing timeout table and sending ALRM signal to qmail-send."

/var/qmail/bin/qmail-tcpok

svc -a /service/qmail-send

;;

queue)

qmail-qstat

qmail-qread

;;

reload|hup)

echo "Sending HUP signal to qmail-send."

svc -h /service/qmail-send

;;

pause)

echo "Pausing qmail-send"

svc -p /service/qmail-send

echo "Pausing qmail-smtpd"

svc -p /service/qmail-smtpd

;;

cont)

echo "Continuing qmail-send"

svc -c /service/qmail-send

echo "Continuing qmail-smtpd"

svc -c /service/qmail-smtpd

;;

restart)

echo "Restarting qmail:"

echo "* Stopping qmail-smtpd."

svc -d /service/qmail-smtpd /service/qmail-smtpd/log

echo "* Sending qmail-send SIGTERM and restarting."

svc -t /service/qmail-send /service/qmail-send/log

echo "* Restarting qmail-smtpd."

svc -u /service/qmail-smtpd /service/qmail-smtpd/log

;;

cdb)

tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

chmod 644 /etc/tcp.smtp.cdb

echo "Reloaded /etc/tcp.smtp."

;;

help)

cat <<HELP

stop -- stops mail service (smtp connections refused, nothing goes out)

start -- starts mail service (smtp connection accepted, mail can go out)

pause -- temporarily stops mail service (connections accepted, nothing leaves)

cont -- continues paused mail service

stat -- displays status of mail service

cdb -- rebuild the tcpserver cdb file for smtp

restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it

doqueue -- schedules queued messages for immediate delivery

reload -- sends qmail-send HUP, rereading locals and virtualdomains

queue -- shows status of queue

alrm -- same as doqueue

flush -- same as doqueue

hup -- same as reload

HELP

;;

*)

echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"

exit 1

;;

esac

exit 0

------------------------------------------------------------------------------------

Link to comment
https://www.neowin.net/forum/topic/254037-qmail-installation/
Share on other sites

You never know, but try changing the interpreter to

#!/bin/bash

Make sure it is the utmost absolute first line.

Also try running the script this way, just to see:

# sh /var/qmail/bin/qmailctl

or

# source /var/qmail/bin/qmailctl

If of course your shell is bash.

I find this to be a very strange problem, this script sounds fine -- it probably just has a malformed shebang line...

One ressource that was particularily useful when I first installed qmail:

http://www.lifewithqmail.com

I now set it up almost blindly -- to the point where I gave myself a challenge and installed it with vpopmail and courrier-*.

  • 1 month later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • About bloody time. I have got PRs with hundred of files and the Web UI just struggling to even load the pages.
    • I wonder if it was applying secure boot certificates/dbx files?
    • I recently tried edge. It seems a lot better. A lot of the junk in it is gone. It seems less bloated and snappy.
    • Lethal fake phone chargers are still being sold on Amazon and eBay, UK watchdog warns by Paul Hill Credit: Pexels The UK consumer rights organization, Which?, is claiming that “potentially lethal knock-off chargers” are still being sold on online marketplaces seven years after it exposed the danger of these chargers. In its latest investigation, it bought 15 USB phone chargers from several online marketplaces and found they were missing key information, meaning they cannot be legally sold in the UK. Which? bought the 15 chargers from seven online marketplaces. These were Amazon (including Amazon Haul), AliExpress, B&Q Marketplace, Debenhams Marketplace, and eBay. It said that the chargers were so badly made that anyone using them was at risk of electric shock. Over half the chargers also posed fire and explosion risks. Of the chargers purchased, one was a fake Apple USB-C 35W power adaptor charger. To confuse buyers, the box was branded with an Apple logo, but testing found it to be a fake. Further testing picked up arcing sounds after 10 seconds of use, where a current jumps between two parts of the electrical circuit, which can cause fires, explosions, or electric shock. The manufacturers of this particular charger also put modeling clay inside it to make it feel more weighty, robust, and genuine. Not all of the chargers were technically faulty; however, some were missing key packaging, markings, and documentation, meaning they can’t be sold in the UK legally. Which? said that it is now campaigning alongside a coalition of safety groups and businesses for new laws that make online marketplaces responsible for ensuring the safety of products that they choose to list on their websites. It also said the government needs to start using powers under the Product Regulation and Metrology Act, which was adopted last July, to impose safety requirements on online marketplaces via secondary legislation, but so far, there have been delays. No matter what country you are in, be sure to properly research what you are buying and only buy authentic chargers to prevent fires. You can read more about Which?’s research here.
    • Visual Studio finally gets long-awaited feature that developers will love by Usama Jawad Visual Studio Code is Microsoft's popular, lightweight, open-source code editor, it is actually Visual Studio that is the company's flagship integrated development environment (IDE). Although the IDE already offers a boatload of useful features for developers, Microsoft has finally introduced a long-requested capability that will be loved by many. While developers have already been able to create Git pull requests (PRs) directly within Visual Studio for the past couple of years, it had not been possible to review a PR without switching to the browser, until now. Microsoft revealed in December 2025 that it is working on UX that enables developers to do just that, and fast-forward to June 2026, and Visual Studio finally has native capabilities to open and inspect a PR, discuss feedback, and wrap up the review, all without switching to the browser. This integration works for both GitHub and Azure DevOps (including on-prem). Developers have access to multiple surfaces to open a PR, including Git Repository, Git Changes, and the Git menu in Visual Studio. Once you open a PR, all the important details will be immediately visible to you, from where you can navigate to various levels of granularity and branch states, depending on the reviews that you are engaged in. As you would expect, you also get a diff view that enables you to see code changes inline or side-by-side in a separate panel. You can also review commit-by-commit. Additionally, this UX fosters collaboration as you can leave comments, reply to threads, and resolve conversations easily. Naturally, you can also leverage Copilot to apply a code suggestion to fix a potential issue. When you are done, you have the ability to approve, complete, and merge the PR. This is a pretty major feature as it has been requested heavily for the past few years. You can try it out in Visual Studio 2026 version 18.7, made available here recently. Microsoft plans to enhance this experience further in future releases with comment filtering, a timeline of PR activity, and more.
  • Recent Achievements

    • Week One Done
      Timaximus earned a badge
      Week One Done
    • One Month Later
      Timaximus earned a badge
      One Month Later
    • Rookie
      FBSPL went up a rank
      Rookie
    • First Post
      davidbazooked earned a badge
      First Post
    • Week One Done
      davidbazooked earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      499
    2. 2
      PsYcHoKiLLa
      174
    3. 3
      +Edouard
      160
    4. 4
      Steven P.
      84
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!