Mailing List Archive

Request help : trying to set up qmail on freebsd-10.1-amd64
Hi,

I am trying to set up a mail server with qmail on a freebsd-10.1-amd64
machine. But at the end of installation and configuration, I am getting
no tcpserver process listing with 'ps waux'.

Could someone kindly suggest what could be wrong with my setup ? The
complete procedure I followed is listed under my signature.

I should note that currently, mail+DNS service for my domain is provided
by a third party. My machine's name is rat.mydomain.amd64, which has to
serve mail for mydomain.com, and rat.mydomain.com is listed as an alias
for ::1 as well as 127.0.0.1 in /etc/hosts.

Thank you for any assistance, &
Regards

Manish Jain


HOST=rat.mydomain.com
cd /var/qmail/configure && ./config-fast $HOST

Install ports qmail, ucsmtp-tcp, daemontools and checkpassword

Disbale sendmail mail as default mailer by executing:
/var/qmail/scripts/enable-qmail

Add to rc.conf:
qmailsmtpd_enable="YES"
qmail_smtp_enable="YES"
qmail_pop_enable="YES"
qmail_enable="YES"
svscan_enable="YES"
svscan_servicedir="/service"

cp /var/qmail/boot/maildir /var/qmail/rc/
ln -s /var/qmail/control /etc/qmail

mkdir /service
csh -cf '/usr/local/bin/svscanboot &'
ps waux | grep svscan #success
echo "csh -cf '/usr/local/bin/svscanboot &'" >> /etc/rc.local

Create /etc/tcp.smtp having the following lines:
127.:allow,RELAYCLIENT=""
192.168.10.:allow,RELAYCLIENT=""
:allow

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

echo '/var/qmail/rc/maildir start' >> /etc/rc.local
/var/qmail/rc/maildir start

#tcpserver should in theory be running now, but is not
Re: Request help : trying to set up qmail on freebsd-10.1-amd64 [ In reply to ]
Thus said Manish Jain on Mon, 09 Mar 2015 16:28:14 +0530:

> cp /var/qmail/boot/maildir /var/qmail/rc/

What is this maildir script?

> echo '/var/qmail/rc/maildir start' >> /etc/rc.local

What is the point of this? If you are using svscan to supervise daemons,
why do you need this?

Andy
--
TAI64 timestamp: 4000000054fdce50
Re: Request help : trying to set up qmail on freebsd-10.1-amd64 [ In reply to ]
Thus said Manish Jain on Mon, 09 Mar 2015 16:28:14 +0530:

> Could someone kindly suggest what could be wrong with my setup ? The
> complete procedure I followed is listed under my signature.

Also, I never saw a step that made it possible for supervise to start
your daemon. Perhaps this is what's wrong?

Andy
--
TAI64 timestamp: 4000000054fdced7
Re: Request help : trying to set up qmail on freebsd-10.1-amd64 [ In reply to ]
Hi Manish



Am 09.03.2015 um 11:58 schrieb Manish Jain <manish.jain@roundabouttech.com>:

> Hi,
>
> I am trying to set up a mail server with qmail on a freebsd-10.1-amd64 machine. But at the end of installation and configuration, I am getting no tcpserver process listing with 'ps waux'.
>
> Could someone kindly suggest what could be wrong with my setup ? The complete procedure I followed is listed under my signature.
>
> I should note that currently, mail+DNS service for my domain is provided by a third party. My machine's name is rat.mydomain.amd64, which has to serve mail for mydomain.com, and rat.mydomain.com is listed as an alias for ::1 as well as 127.0.0.1 in /etc/hosts.
>

Well, I’m not sure what you are looking for (just qmail listing to the loopback if ?), but lets try to solve your problem systematically:

0. You probably uses some qmail ports available for FreeBSD. There are others, but anyway.

>
> HOST=rat.mydomain.com
> cd /var/qmail/configure && ./config-fast $HOST
>
> Install ports qmail, ucsmtp-tcp, daemontools and checkpassword
>
> Disbale sendmail mail as default mailer by executing:
> /var/qmail/scripts/enable-qmail
>

1. I typically use:

rc.conf: sendmail_enable=„NONE"

lrwxr-xr-x 1 root wheel 23 Apr 25 2014 /usr/sbin/sendmail -> /var/qmail/bin/sendmail

2. This is required by the qmail port; it doesn’t harm anyway:

> Add to rc.conf:
> qmailsmtpd_enable="YES"
> qmail_smtp_enable="YES"
> qmail_pop_enable="YES"
> qmail_enable="YES"
> svscan_enable="YES"
> svscan_servicedir="/service“
>

3. Linking the control files to /etc as qmail doesn’t matter at all:


> cp /var/qmail/boot/maildir /var/qmail/rc/
> ln -s /var/qmail/control /etc/qmail
>

4. Ok. Supervise should work and recognize the /service dir:

> mkdir /service
> csh -cf '/usr/local/bin/svscanboot &'
> ps waux | grep svscan #success
> echo "csh -cf '/usr/local/bin/svscanboot &'" >> /etc/rc.local
>

5. Ok:

> Create /etc/tcp.smtp having the following lines:
> 127.:allow,RELAYCLIENT=""
> 192.168.10.:allow,RELAYCLIENT=""
> :allow
>
> tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
>

6. This is an artifact from the port:

> echo '/var/qmail/rc/maildir start' >> /etc/rc.local
> /var/qmail/rc/maildir start
>
> #tcpserver should in theory be running now, but is not
>

7. To setup qmail (for sending)

mkdir -p /service/qmail-send/log

a) Copy the following file as ‚run‘ script (chmod +x) into the log dir:

#!/bin/sh
cd ..
LOG_NAME=`basename ${PWD}`
cd -
LOG_DIR="/var/log/${LOG_NAME}"
if [ ! -d "${LOG_DIR}" ]; then
mkdir -p "${LOG_DIR}"
chown qmaill:nofiles "${LOG_DIR}"
echo "Creating log dir for ${LOG_NAME}:"
ls -ld "${LOG_DIR}"
fi
exec 2>&1
exec setuidgid qmaill multilog t s2000000 "${LOG_DIR}“

b) Copy the following input as ‚run‘ script under /service/qmail-send:

#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/


8. To setup qmail (for receiving SMTP mails):

mkdir -p /service/qmail-smtpd/log

a) Copy the following file as ‚run‘ script (chmod +x) into log:

#!/bin/sh
cd ..
LOG_NAME=`basename ${PWD}`
cd -
LOG_DIR="/var/log/${LOG_NAME}"
if [ ! -d "${LOG_DIR}" ]; then
mkdir -p "${LOG_DIR}"
chown qmaill:nofiles "${LOG_DIR}"
echo "Creating log dir for ${LOG_NAME}:"
ls -ld "${LOG_DIR}"
fi
exec 2>&1
exec setuidgid qmaill multilog t s2000000 "${LOG_DIR}“

b) Copy the following input as ‚run‘ script under /service/qmail-smtpd:

#!/bin/sh
# qmail-smtpd startup with SMTP Authentication
QMAILDUID=`id -u qmaild`
QMAILDGID=`id -g qmaild`
HOSTNAME=`hostname`
exec softlimit -m 2000000 \
tcpserver -vR -l $HOSTNAME \
-u $QMAILDUID -g $QMAILDGID 0 smtp \
/var/qmail/bin/qmail-smtpd 2>&1


9. Verification:

svc -du /service/qmail*/log
svc -du /service/qmail*

svstat /service/qmail*
svstat /service/qmail*/log


10. Further information (for my Spamcontrol patch):

http://www.fehcom.de/qmail/spamcontrol/README_spamcontrol.html

regards.
—eh.



---
Dr. Erwin Hoffmann | FEHCom | http://www.fehcom.de | PGP Key-Id: 7E4034BE