Using squirrelmail + qmail + courier-imap under FreeBSD ( installed via ports )

Mattias Björk tysken at tysken.un1x.la
Thu May 29 06:05:24 PDT 2003


Hi,

Sorry for repeating this message I did send a simlar message yestareday
but I have added more information se perhaps It would help clearing out
some questions and added more information about what I have done to try to
solve the problem.

Im using squirrelmail + qmail and courier-imap. I have read the qmail FAQ
about relaying ( question 5.4 I think ) And have done that but I can't
still get relaying to work. And running it under FreeBSD 4.8-stable.

My server is has ip 195.162.89.241 against the internet and 192.168.0.10
as the LAN ip.

My /etc/tcp.smtp does look like this:

192.168.0.:allow,RELAYCLIENT=""
127.:allow,RELAYCLIENT=""
:allow

------------EOF---------------

And my /var/qmail/control/rcpthosts does look like this:

dasboot.birch.se
thrawn.birch.se
setiathome.birch.se
localhost
tysken.un1x.la
webmail.tysken.un1x.la

------------EOF---------------

setiathome.birch.se is the name of the server in the LAN with ip 
192.168.0.10
and the domain name from/for the internet is tysken.un1x.la and
webmail.tysken.un1x.la.

*.birch.se are as you can see internal hostnames.

And now I will show the qmail startup script ( sorry if it does look like a
mess, but that depends on how your mail-client warps it )

#!/bin/sh

#
# This script starts and stops the qmail mail functions.
#

# Suck in the configuration variables.

case "$1" in
start)
                # Start the qmail smtp daemon
                envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir
/usr/local/bin/tcpserver -H -R -c 255 \
                        -u 82 -g 81 0 smtp /usr/local/bin/relay-ctrl-check
/var/qmail/bin/qmail-smtpd 2>&1 | setuidgid qmaill multilog t s1000000 n10
/var/log/qmail/qmail-smtpd/ &

              #/usr/local/bin/tcpserver -H -R -c 255 -x /etc/tcp.smtp.cdb \
              #          -u 82 -g 81 0 smtp /var/qmail/bin/qmail-smtpd 2>&1 
|
setuidgid qmaill multilog t s1000000 n10 /var/log/qmail/qmail-smtpd/ &
                echo -n " qmail-smtp"

                envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir
/usr/local/bin/tcpserver -H -R -c 255 0 pop3 \
                        /var/qmail/bin/qmail-popup tysken.un1x.la \
                        /usr/local/bin/checkpassword
/usr/local/bin/relay-ctrl-allow /var/qmail/bin/qmail-pop3d \
                         Maildir 2>&1 | setuidgid qmaill multilog t
s1000000 n10
/var/log/qmail/qmail-pop3d &

              #  /usr/local/bin/tcpserver -H -R -c 255 0 pop3 \
              #          /var/qmail/bin/qmail-popup tysken.un1x.la \
              #          /usr/local/bin/checkpassword
/var/qmail/bin/qmail-pop3d \
              #           Maildir 2>&1 | setuidgid qmaill multilog t 
s1000000
n10 /var/log/qmail/qmail-pop3d &
                echo -n " qmail-pop"

                exec env - PATH="/var/qmail/bin:$PATH" \
                        qmail-start ./Maildir splogger qmail &
                echo -n " qmail"
#               echo "qmail started and ready"
        ;;

reload)

        qmailpid=`ps -axw | grep qmail-send | grep -v grep | awk '{ print
$1 }'`
        if [ $qmailpid != "" ]; then
                qmail-tcpok
                kill -14 $qmailpid
                kill -1 $qmailpid
#       echo Reloading qmail and restarting the queue.
        fi
        ;;

stop)
        # Stop the smtp daemon
        smtppid=`ps -axw | grep tcpserver | grep smtp | grep -v grep | awk 
'{
print $1 }'`
        if [ "$smtppid" != "" ]; then
                kill $smtppid
                echo -n " qmail-smtp"
        fi

        # Stop the pop daemon
        poppid=`ps -axw | grep tcpserver | grep popup | grep -v grep | awk 
'{
print $1 }'`
        if [ "$poppid" != "" ]; then
                kill $poppid
                echo -n " qmail-pop"
        fi

        # Stop qmail
        qmailpid=`ps -axw | grep qmail-send | grep -v grep | awk '{ print
$1 }'`
        if [ "$qmailpid" != "" ]; then
                kill $qmailpid
                echo -n " qmail"
#       echo Stopping qmail daemons.
        fi
        ;;
*)
        echo "Usage: `basename $0` {reload|start|stop}" >&2
        ;;
esac

exit 0

------------EOF---------------

As you could see I have two examples but one of the commented out. One is
with only tcpserver with -x switch pointing at /etc/tcp.smtp.cdb file. And
the other is with tcpserver without the -x switch and with relay-ctrl
instead.

Anyway here is the problem when I try to send to a domain not listed in
/var/qmail/control/rcpthosts I get this error message:

"Requested action not taken: mailbox name not allowed"
"Servern svarade: 553 sorry, that domain isn't in my list of allowed
rcpthosts
(#5.7.1)"

My courier-imap startup script in /usr/local/etc/rc.d/ does look like
this, note that I have added the "/usr/local/bin/envdir /etc/relay-ctrl
/usr/local/bin/relay-ctrl-chdir \" in there as I have read on this url
"http://www.ornl.gov/its/archives/mailing- 
lists/qmail/2002/02/msg00278.html"
But I still can't It to get working proper.

#! /bin/sh
# $Id: imapd.rc.in,v 1.22 2002/12/24 02:31:40 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
# See COPYING for distribution information.

prefix=/usr/local
exec_prefix=/usr/local
bindir=${exec_prefix}/bin
libexecdir=/usr/local/libexec/courier-imap

TLS_CACHEFILE=""
. /usr/local/etc/courier-imap/imapd-ssl
. /usr/local/etc/courier-imap/imapd

case $1 in
start)
        LIBAUTHMODULES=""
        for f in `echo $AUTHMODULES`
        do
                LIBAUTHMODULES="$LIBAUTHMODULES
/usr/local/libexec/courier-imap/authlib/$f"
        done

        if test -x ${libexecdir}/authlib/authdaemond
        then
                /usr/bin/env - ${libexecdir}/authlib/authdaemond start
        fi

        if test "$TLS_CACHEFILE" != ""
        then
                rm -f $TLS_CACHEFILE
        fi

        ulimit -v $IMAP_ULIMITD
        /usr/bin/env - /bin/sh -c " set -a ;
                        prefix=/usr/local ;
                        exec_prefix=/usr/local ;
                        bindir=${exec_prefix}/bin ;
                        libexecdir=/usr/local/libexec/courier-imap ;
                                . /usr/local/etc/courier-imap/imapd ; \
                                . /usr/local/etc/courier-imap/imapd-ssl ; \
                IMAP_STARTTLS=$IMAPDSTARTTLS ; export IMAP_STARTTLS ; \
                TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL ; \

# This line have I added by my self
                /usr/local/bin/envdir /etc/relay-ctrl
/usr/local/bin/relay-ctrl-chdir \

#
                /usr/local/libexec/courier-imap/couriertcpd
-address=$ADDRESS \

-stderrlogger=/usr/local/libexec/courier-imap/courierlogger \
                        -stderrloggername=imapd \
                        -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
                        -pid=$PIDFILE $TCPDOPTS \
                        $PORT ${exec_prefix}/sbin/imaplogin $LIBAUTHMODULES 
\
                                ${exec_prefix}/bin/imapd Maildir"
        ;;
stop)
        /usr/local/libexec/courier-imap/couriertcpd -pid=$PIDFILE -stop
        if test -x ${libexecdir}/authlib/authdaemond
        then
                ${libexecdir}/authlib/authdaemond stop
        fi
        ;;
esac
exit 0

------------EOF---------------

I might be misstaking but I don't think that this is a courier-imap
problem but rather a qmail problem. Perhaps for somehow that qmail is
ignoring the fact that tcpserver uses the "-x" switch and reads
/etc/tcp.smtp.cdb for some reason. But again im just a newbie on this
things so I can't be sure.

Im not lazy perhaps Im dumb but I have trying to get this to work under
three days and I have read mailinglists and documentation but I can't
still get it to work so don't think that emailing this to the lists is the
first thing Im doing.

If someone could help me with setup tcpserver with courier-imap I would be
glad but I don't know it that will help me any.

Im planying to get imap-ssl working as well but that could wait until this
other "major" problem is sloved.

At the moment I can't figure out any other useful information that I can
submit other than if i remove /var/qmail/control/rcpthosts file it works
fine but that is futile because then as we all know anybody could use my
MTA as a relay.

Mvh Mattias Björk



More information about the freebsd-questions mailing list