Index: openacs-4/packages/acs-core-docs/www/install-qmail.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-qmail.html,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/install-qmail.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/install-qmail.html 4 Feb 2004 16:47:33 -0000 1.16 @@ -1,35 +1,35 @@ -Install qmail (OPTIONAL)

Install qmail (OPTIONAL)

Qmail is a Mail Transfer Agent. It handles incoming and +Install qmail (OPTIONAL)

Install qmail (OPTIONAL)

Qmail is a Mail Transfer Agent. It handles incoming and outgoing mail. Install qmail if you want your OpenACS server to send and receive mail, and you don't want to use an alternate MTA.

Red Hat 9: all djb tools (qmail, daemontools, ucspi) will fail to compile in Red Hat 9 because of changes to glibc (patches)

  1. Install ucspi.�This program handles incoming tcp connections. - Download ucspi and install it.

    [root@yourserver root]# cd /usr/local/src
    -[root@yourserver src]# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
    -[root@yourserver src]# tar xzf ucspi-tcp-0.88.tar.gz
    +            Download ucspi and install it.

    [root root]# cd /usr/local/src
    +[root src]# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
    +[root src]# tar xzf ucspi-tcp-0.88.tar.gz
     cd /usr/local/src 
     wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
     tar xzf ucspi-tcp-0.88.tar.gz 

    Red Hat 9 only

    wget http://moni.csi.hu/pub/glibc-2.3.1/ucspi-tcp-0.88.errno.patch
     cd ucspi-tcp-0.88
     patch -p1 <../ucspi-tcp-0.88.errno.patch
    -cd ..

    All platforms continue:

    [root@yourserver src]# cd ucspi-tcp-0.88
    -[root@yourserver ucspi-tcp-0.88]# make
    +cd ..

    All platforms continue:

    [root src]# cd ucspi-tcp-0.88
    +[root ucspi-tcp-0.88]# make
     ( cat warn-auto.sh; \
     echo 'main="$1"; shift'; \(many lines omitted)
     ./compile instcheck.c
     ./load instcheck hier.o auto_home.o unix.a byte.a
    -[root@yourserver ucspi-tcp-0.88]# make setup check
    +[root ucspi-tcp-0.88]# make setup check
     ./install
     ./instcheck
    -[root@yourserver ucspi-tcp-0.88]#
    +[root ucspi-tcp-0.88]#
     
     cd ucspi-tcp-0.88 
     make 
     make setup check

    Verify that ucspi-tcp was installed successfully by -running the tcpserver program which is part of ucspi-tcp:

    [root@yourserver ucspi-tcp-0.88]# tcpserver
    +running the tcpserver program which is part of ucspi-tcp:

    [root ucspi-tcp-0.88]# tcpserver
     tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid
     ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program
    -[root@yourserver ucspi-tcp-0.88]#
    -

    +[root ucspi-tcp-0.88]# +

    (I'm not sure if this next step is 100% necessary, but when I skip it I get problems. If you get the error 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) then you need to do this.) AOLserver sends outgoing mail via the ns_sendmail command, which pipes a command to the sendmail executable. Or, in our @@ -40,13 +40,13 @@ Unless this mail is addressed to the same machine, qmail thinks that it's an attempt to relay mail, and rejects it. So these two commands set up an exception so that any mail sent from 127.0.0.1 is allowed to -send outgoing mail.

    [root@yourserver ucspi-tcp-0.88]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp
    -[root@yourserver ucspi-tcp-0.88]# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp 
    -tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp 
  2. Install Qmail.�

    Download qmail, - set up the standard supporting users and build the binaries:

    [root@yourserver root]# cd /usr/local/src
    -[root@yourserver src]# wget http://www.qmail.org/netqmail-1.04.tar.gz
    -[root@yourserver src]# tar xzf netqmail-1.04.tar.gz
    +send outgoing mail.

    [root ucspi-tcp-0.88]# cp /tmp//packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp
    +[root ucspi-tcp-0.88]# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
    +cp /tmp//packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp 
    +tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp 
  3. Install Qmail.�

    Download qmail, + set up the standard supporting users and build the binaries:

    [root root]# cd /usr/local/src
    +[root src]# wget http://www.qmail.org/netqmail-1.04.tar.gz
    +[root src]# tar xzf netqmail-1.04.tar.gz
     --15:04:11--  http://www.qmail.org/netqmail-1.04.tar.gz
                => `netqmail-1.04.tar.gz'
     Resolving www.qmail.org... done.
    @@ -58,18 +58,18 @@
     
     15:04:21 (24.04 KB/s) - `netqmail-1.04.tar.gz' saved [242310/242310]
     
    -[root@yourserver src]# mkdir /var/qmail
    -[root@yourserver src]# groupadd nofiles
    -[root@yourserver src]# useradd -g nofiles -d /var/qmail/alias alias
    -[root@yourserver src]# useradd -g nofiles -d /var/qmail qmaild
    -[root@yourserver src]# useradd -g nofiles -d /var/qmail qmaill
    -[root@yourserver src]# useradd -g nofiles -d /var/qmail qmailp
    -[root@yourserver src]# groupadd qmail
    -[root@yourserver src]# useradd -g qmail -d /var/qmail qmailq
    -[root@yourserver src]# useradd -g qmail -d /var/qmail qmailr
    -[root@yourserver src]# useradd -g qmail -d /var/qmail qmails
    -[root@yourserver src]# cd netqmail-1.04
    -[root@yourserver netqmail-1.04]# ./collate.sh
    +[root src]# mkdir /var/qmail
    +[root src]# groupadd nofiles
    +[root src]# useradd -g nofiles -d /var/qmail/alias alias
    +[root src]# useradd -g nofiles -d /var/qmail qmaild
    +[root src]# useradd -g nofiles -d /var/qmail qmaill
    +[root src]# useradd -g nofiles -d /var/qmail qmailp
    +[root src]# groupadd qmail
    +[root src]# useradd -g qmail -d /var/qmail qmailq
    +[root src]# useradd -g qmail -d /var/qmail qmailr
    +[root src]# useradd -g qmail -d /var/qmail qmails
    +[root src]# cd netqmail-1.04
    +[root netqmail-1.04]# ./collate.sh
     
     You should see 7 lines of text below.  If you see anything
     else, then something might be wrong.
    @@ -80,8 +80,8 @@
     [5] Renaming qmail-1.03 to netqmail-1.04...
     [6] Continue installing qmail using the instructions found at:
     [7] http://www.lifewithqmail.org/lwq.html#installation
    -[root@yourserver netqmail-1.04]# cd netqmail-1.04
    -[root@yourserver netqmail-1.04]# make setup check
    +[root netqmail-1.04]# cd netqmail-1.04
    +[root netqmail-1.04]# make setup check
     ( cat warn-auto.sh; \
     echo CC=\'`head -1 conf-cc`\'; \(many lines omitted)
     ./install
    @@ -102,11 +102,11 @@
     cd netqmail-1.04
     ./collate.sh
     cd netqmail-1.04
    -make setup check

    Replace sendmail with qmail's wrapper.

    [root@yourserver qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
    -[root@yourserver qmail-1.03]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
    -[root@yourserver qmail-1.03]#
    +make setup check

    Replace sendmail with qmail's wrapper.

    [root qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
    +[root qmail-1.03]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
    +[root qmail-1.03]#
     rm -f /usr/bin/sendmail /usr/sbin/sendmail
    -ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

    Configure qmail - specifically, run the config script to set up files in /var/qmail/control specifying the computer's identity and which addresses it should accept mail for. This command will automatically set up qmail correctly if you have correctly set a valid host nome. If not, you'll want to read /var/qmail/doc/INSTALL.ctl to find out how to configure qmail.

    [root@yourserver qmail-1.03]# ./config-fast yourserver.test
    +ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

    Configure qmail - specifically, run the config script to set up files in /var/qmail/control specifying the computer's identity and which addresses it should accept mail for. This command will automatically set up qmail correctly if you have correctly set a valid host nome. If not, you'll want to read /var/qmail/doc/INSTALL.ctl to find out how to configure qmail.

    [root qmail-1.03]# ./config-fast yourserver.test
     Your fully qualified host name is yourserver.test.
     Putting yourserver.test into control/me...
     Putting yourserver.test into control/defaultdomain...
    @@ -115,67 +115,67 @@
     Putting yourserver.test into control/rcpthosts...
     Now qmail will refuse to accept SMTP messages except to yourserver.test.
     Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
    -[root@yourserver qmail-1.03]#
    -./config-fast yourserver.test

    All incoming mail that isn't for a specific user is handled by the alias user. This includes all root mail. These commands prepare the alias user to receive mail.

    [root@yourserver qmail-1.03]# cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
    -[root@yourserver alias]# chmod 644 ~alias/.qmail*
    -[root@yourserver alias]# /var/qmail/bin/maildirmake ~alias/Maildir/
    -[root@yourserver alias]# chown -R alias.nofiles /var/qmail/alias/Maildir
    -[root@yourserver alias]#
    +[root qmail-1.03]#
    +./config-fast yourserver.test

    All incoming mail that isn't for a specific user is handled by the alias user. This includes all root mail. These commands prepare the alias user to receive mail.

    [root qmail-1.03]# cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
    +[root alias]# chmod 644 ~alias/.qmail*
    +[root alias]# /var/qmail/bin/maildirmake ~alias/Maildir/
    +[root alias]# chown -R alias.nofiles /var/qmail/alias/Maildir
    +[root alias]#
     cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root 
     chmod 644 ~alias/.qmail* 
     /var/qmail/bin/maildirmake ~alias/Maildir/ 
    -chown -R alias.nofiles /var/qmail/alias/Maildir

    Configure qmail to use the Maildir delivery format - (instead of mbox), and install a version of the qmail startup script modified to use Maildir.

    [root@yourserver alias]# echo "./Maildir" > /var/qmail/bin/.qmail
    -[root@yourserver alias]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc
    -[root@yourserver alias]# chmod 755 /var/qmail/rc
    -[root@yourserver alias]# 
    +chown -R alias.nofiles /var/qmail/alias/Maildir

    Configure qmail to use the Maildir delivery format + (instead of mbox), and install a version of the qmail startup script modified to use Maildir.

    [root alias]# echo "./Maildir" > /var/qmail/bin/.qmail
    +[root alias]# cp /tmp//packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc
    +[root alias]# chmod 755 /var/qmail/rc
    +[root alias]# 
     echo "./Maildir" > /var/qmail/bin/.qmail 
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc 
    +cp /tmp//packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc 
     chmod 755 /var/qmail/rc 
     

    Set up the skeleton directory so that new users will - be configured for qmail.

    [root@yourserver root]# /var/qmail/bin/maildirmake /etc/skel/Maildir
    -[root@yourserver root]# echo "./Maildir/" > /etc/skel/.qmail
    -[root@yourserver root]# 
    +          be configured for qmail.

    [root root]# /var/qmail/bin/maildirmake /etc/skel/Maildir
    +[root root]# echo "./Maildir/" > /etc/skel/.qmail
    +[root root]# 
     /var/qmail/bin/maildirmake /etc/skel/Maildir
     echo "./Maildir/" > /etc/skel/.qmail

    As recommended, we will run qmail with daemontools - control files. Create daemontools control directories, set up a daemontools control script, copy the supervise control files, and set permissions. The last line links the control directories to /service, which will cause supervise to detect them and execute the run files, causing qmail to start.

    [root@yourserver root]# mkdir -p /var/qmail/supervise/qmail-send/log
    -[root@yourserver root]# mkdir -p /var/qmail/supervise/qmail-smtpd/log
    -[root@yourserver root]# mkdir /var/log/qmail
    -[root@yourserver root]# chown qmaill /var/log/qmail
    -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
    -[root@yourserver root]# chmod 755 /var/qmail/bin/qmailctl
    -[root@yourserver root]# ln -s /var/qmail/bin/qmailctl /usr/bin
    -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run 
    -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
    -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
    -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
    -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-send/run
    -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-send/log/run
    -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-smtpd/run
    -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
    -[root@yourserver root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
    -[root@yourserver root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
    +          control files.  Create daemontools control directories, set up a daemontools control script, copy the supervise control files, and set permissions.  The last line links the control directories to /service, which will cause supervise to detect them and execute the run files, causing qmail to start.

    [root root]# mkdir -p /var/qmail/supervise/qmail-send/log
    +[root root]# mkdir -p /var/qmail/supervise/qmail-smtpd/log
    +[root root]# mkdir /var/log/qmail
    +[root root]# chown qmaill /var/log/qmail
    +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
    +[root root]# chmod 755 /var/qmail/bin/qmailctl
    +[root root]# ln -s /var/qmail/bin/qmailctl /usr/bin
    +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run 
    +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
    +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
    +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
    +[root root]# chmod 755 /var/qmail/supervise/qmail-send/run
    +[root root]# chmod 755 /var/qmail/supervise/qmail-send/log/run
    +[root root]# chmod 755 /var/qmail/supervise/qmail-smtpd/run
    +[root root]# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
    +[root root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
    +[root root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
     mkdir -p /var/qmail/supervise/qmail-send/log
     mkdir -p /var/qmail/supervise/qmail-smtpd/log
     mkdir /var/log/qmail
     chown qmaill /var/log/qmail
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
    +cp /tmp//packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
     chmod 755 /var/qmail/bin/qmailctl
     ln -s /var/qmail/bin/qmailctl /usr/bin
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
    -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
    +cp /tmp//packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run
    +cp /tmp//packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
    +cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
    +cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
     chmod 755 /var/qmail/supervise/qmail-send/run
     chmod 755 /var/qmail/supervise/qmail-send/log/run
     chmod 755 /var/qmail/supervise/qmail-smtpd/run
     chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
     ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
    -

    Wait ten seconds or so, and then verify that that the four qmail processes are running. If uptimes don't rise above 1 second, this may indicate broken scripts that are continuously restarting. In that case, start debugging by checking permissions.

    [root@yourserver root]# qmailctl stat
    +

    Wait ten seconds or so, and then verify that that the four qmail processes are running. If uptimes don't rise above 1 second, this may indicate broken scripts that are continuously restarting. In that case, start debugging by checking permissions.

    [root root]# qmailctl stat
     /service/qmail-send: up (pid 32700) 430 seconds
     /service/qmail-send/log: up (pid 32701) 430 seconds
     /service/qmail-smtpd: up (pid 32704) 430 seconds
     /service/qmail-smtpd/log: up (pid 32705) 430 seconds
     messages in queue: 0
     messages in queue but not yet preprocessed: 0
    -[root@yourserver root]#

    Further verify by sending and receiving email. Incoming mail for root is stored in /var/qmail/alias/Maildir.

View comments on this page at openacs.org
+[root root]#

Further verify by sending and receiving email. Incoming mail for root is stored in /var/qmail/alias/Maildir.

View comments on this page at openacs.org