This HOWTO (which should be named "misleading install guide that is too old to be taken seriously) no longer matches Oli's at pofo.de. Please direct your attention to lifewithqmail.org for better help and more details. (I'm only leaving this up until I can figure out how to gracefully remove it.)
SF - 2005-11-30
This section deals with the configuration of the services installed in Chapter 1.
Firstly, the start scripts from the FreeBSD port must be deactivated.
With the next three commands, we will create three empty files. If qmail were not installed with vpopmail, these three files would indicate the account to which emails to the respective (special) accounts would be forwarded.
Due to the fact that vpopmail is now responsible for the domains and subsequent users, the qmail POP3 daemon must be configured so that it is no longer responsible for any domains.
The next three commands/lines cause the server to respond to others with a valid domain name (in conformation with the proper RFC's). This also allows for emails to be processed where the domain is not directly indicated [(i.e. the email coming from the account "steve" will be tagged with @domain1.tld).]
hostname | sed "s/`hostname -s`.//g" > /var/qmail/control/defaultdomain
hostname | sed "s/`hostname -s`.//g" > /var/qmail/control/plusdomain
After a successful authentication through one of the mail services, SMTP will be available for relay to that specific IP for a given amount of time. Thusly, unauthorized relaying will be prohibited or impossible. In order to make the the time period limited, the following should be placed in your crontab file:
echo "40 * * * * /usr/local/vpopmail/bin/clearopensmtp >/dev/null 2>&1 " >>crontab
crontab crontab -u root
[For some reason the above commands do not work for me, and I do the *wrong* thing and edit the crontab file by hand with the second line. Make a backup of your current crontab file - yes, I have even wiped it out accidentaly - before you perform these commands or make any changes.]
At first, the given configuration files can be used without modification.
for i in imapd imapd-ssl imapd.cnf pop3d pop3d-ssl pop3d.cnf ; do \
cp /usr/local/etc/courier-imap/$i.dist /usr/local/etc/courier-imap/$i ; \
The POP3s and IMAP4s each require an SSL-certificate. You can create one by entering the following commands:
Next, the supplied start script will be modified with the following hack.
Now the POP3s, IMAP4 and IMAP4s services are ready to start. In order to have the services start after a power-up or restart, the following shell scripts should be copied to the /usr/local/etc/rc.d directory:
install -m 755 imapd.rc /usr/local/etc/rc.d/imapd.sh
install -m 755 imapd-ssl.rc /usr/local/etc/rc.d/imapd-ssl.sh
install -m 755 pop3d-ssl.rc /usr/local/etc/rc.d/pop3d-ssl.sh
The service scripts for POP3, SMTP and the distribution agent for the emails will be configured and installed:
echo ":allow" >tcp
echo "200" > env/CONCURRENCY
/var/qmail/bin/qmail-smtpd-conf qmaild qmaill /var/qmail/service/smtpd
echo "200" > env/CONCURRENCY
rm -f tcp.cdb tcp
ln -s /usr/local/vpopmail/etc/tcp.smtp.cdb /var/qmail/service/smtpd/tcp.cdb
ln -s /usr/local/vpopmail/etc/tcp.smtp /var/qmail/service/smtpd/tcp
echo '#!/bin/sh' >/var/qmail/rc
echo 'exec env - PATH="/var/qmail/bin:$PATH" \' >>/var/qmail/rc
echo 'qmail-start ./Maildir/ /usr/local/bin/multilog t /var/log/qmail qmaill' >>/var/qmail/rc
chmod 755 /var/qmail/rc
/var/qmail/bin/qmail-delivery-conf qmaill /var/qmail/service/qmail
chmod 750 /var/log/qmail
chown qmaill /var/log/qmail
The program "svscan" [(the daemontools service)] searches through all of the subdirectories of a /service directory for a script called "run." The /service directory must be created and symbolic links made to the directories where the services are located that you want run.
ln -s /var/qmail/service/pop3d /var/service/pop3d
ln -s /var/qmail/service/smtpd /var/service/smtpd
ln -s /var/qmail/service/qmail /var/service/qmail
The start script for "svscan" (i.e. daemontools) must be activated in order for svscan to work after a system reboot.
chmod 744 /usr/local/etc/rc.d/0svscan.sh