Installing qmail

  1. cd /usr/ports/mail/qmail
  2. make install
    make install WITH_QMAILQUEUE_PATCH=yes (if you plan on using qmail-scanner)

After qmail installs, you will get the following message:


Please make sure that you read /var/qmail/doc/PORT_NOTES.  It
contains important information about testing and configuring qmail,
and finally replacing sendmail with qmail.

You should also add /var/qmail/man to your MANPATH (see manpath(1)
or login.conf(5)).

You can enable qmail as your default mailer:

# this will disable the default MTA 1) do "make disable-sendmail"

# enable qmail as your default MTA 2) do "make enable-qmail"
===>   Generating temporary packing list
===>   Compressing manual pages for qmail-1.03_1
===>   Registering installation for qmail-1.03_1
      This port has installed the following binaries which execute with
      increased privileges.
 46866   26 -rws--x--x    1 qmailq           qmail               12772 Sep 15 20:24 /var/qmail/bin/qmail-queue

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:

Let's finish the installation. As the superuser:

  1. make disable-sendmail
    ===> I hope you know what you are doing:
    ===> You just told your system to not
    ===> automaticaly start sendmail on your
    ===> next startup.
    ===> (i.e., added sendmail_enable=\¨NO\¨ to rc.conf)
  2. make enable-qmail
    ===> I hope you know what you are doing:
    ===> You just told your system to not
    ===> automaticaly start sendmail on your
    ===> next startup.
    ===> (i.e., added sendmail_enable=\¨NO\¨ to rc.conf)
    ===> Do not forget to choose an appropriate qmail startup
    ===> script. Go through /var/qmail/boot, choose one
    ===> and copy the chosen script as /var/qmail/rc
    ===> For example, \¨cp /var/qmail/boot/proc+df /var/qmail/rc\¨
  3. We're going to use maildir:
    cp /var/qmail/boot/maildir /var/qmail/rc

Now we need to setup tcpserver to allow the local machines to send out mail

  1. cd
  2. wget
  3. tar xzf ucspi-tcp-0.88.tar.gz
  4. cd ucspi-tcp-0.88.tar.gz
  5. make
  6. make setup check
  7. rehash
  8. cd /usr/local/etc
  9. Create a file tcp.smtp with the following lines:

    Refer to qmail-HOWTO for more instructions.
    Refer to Selective relaying with tcpserver and qmail-smtpd for more information. You can substitute 192.168.0. for the address(es) which are allowed to use this machine as a SMTP server.
  10. tcprules tcp.smtp.cdb tcp.smtp.temp < tcp.smtp
  11. Edit /etc/rc.local and add the following line:
    tcpserver -x/etc/tcp.smtp.cdb -u82 -g81 0 smtp /var/qmail/bin/qmail-smtpd &
    change 82 to your qmaild user id (look at /etc/passwd, it's the first number) and change 81 to your qnofiles group id (look at /etc/groups, it's the only number on that line)

You're almost done. Check /var/qmail/control to see if there are any files in that directory. At minimum, you should have a file /var/qmail/control/me which contains a single line with your domain name (ie.

If you need to host virtual domains, you will need to create a /var/qmail/control/virtualdomains file and a /var/qmail/control/rcpthosts file. The virtualdomains file contains a list of the domains in this format: is the domain and domain-admin is a real system user (ie you) who will store the .qmail- file for each email account. The rcpthosts file contains a list of the domains for which this server is receiving mail. You should set rcpthosts to receive mail for this machine's domain (ie

Next we need to setup the Maildir

  1. Login to your personal account
  2. /var/qmail/bin/maildirmake $HOME/Maildir
  3. echo ./Maildir/ > ~/.qmail

That's it. Reboot the machine to verify that qmail and tcpserver come up after booting.

If you want, you can install a mail reader such as elm (/usr/ports/mail/elm) or pine (/usr/ports/mail/pine). /var/qmail/bin/elq and /var/qmail/bin/pinq are wrappers to elm and pine respectively. These scripts will change the Maildir format to mailbox format. You will also need to add these lines to the .cshrc file:

setenv MAILDIR $HOME/Maildir
setenv MAIL $HOME/Mailbox.$USER
setenv MAILTMP $HOME/Mailbox.tmp

Continue on with the OpenACS 4.x installation

IC Design: view list
2002-08-07: Orchard Labs, Inc. introduces Internet Consulting and IC Consulting services.

2002-08-07: Read the OpenACS 4.5 FreeBSD Installation Guide.

2002-08-07: Read about the Orchard Labs Community System (OLCS).

© 2000-2002 Orchard Labs, Inc.