# Smtp Auth



## Gabriel Camiro (May 14, 2003)

Herw is a good how-to for smtp auth with sendmail: http://www.jonfullmer.com/smtpauth/

Here are my problems so far. I downloaded cyrus-sasl and tried to compile it, but a got a buch of errors. I checked and ther is a package for fink. Then I must recompile sendmail to make it work and I don't know if I can download a special  version.
Has anyone tried this before?
Also I found in /usr/lib a file named sasl2

Has anyone tried smtp authentication?


----------



## Gimpy00Wang (May 14, 2003)

I have implemented smtp auth with QMail, but not with Sendmail. We moved away from Sendmail a little over a year ago after getting tired of its limitations and vulnerabilities. If you can, I would strongly suggest checking out QMail. If you're used to Sendmail, QMail will seem a little odd, but it's super-stable and well worth the migration.

- G!mpy


----------



## Gabriel Camiro (May 14, 2003)

wow! I'm realy interested to do that.
Do you have some links for that?


----------



## Gimpy00Wang (May 14, 2003)

http://www.qmail.org/  Just choose a mirror that's close to you. To get smtp auth in QMail, there is a patch. I use this one:

http://members.elysium.pl/brush/qmail-smtpd-auth/

Now, depending how you want to do things, QMail is not all that you need. Grab QMail and the smtp auth patch for sure, but if you want to use virtual users, grab vpopmail. If you want to make account management easy, greab QMailAdmin (web-based email account management tool).

- G!mpy


----------



## Gimpy00Wang (May 14, 2003)

Oh yeah, the links for vpopmail and such are:

http://www.inter7.com/vpopmail.html
http://www.inter7.com/qmailadmin.html

If you want IMAP, use Courier-IMAP, available here:

http://www.inter7.com/courierimap.html

And...for kewl webmail, use Horde:

http://www.horde.org/

-G!mpy


----------



## Gabriel Camiro (May 14, 2003)

ok, I'll check it. 
Thanks a lot


----------



## wyvern (May 14, 2003)

Postfix also has a lot of fans.

I tried about 6 months ago to get qmail working on OS X. I never succeeded, and I consider myself fairly unix-savvy. Perhaps it's better now.

Exim is supposed to compile easily on OS X, fwiw.


----------



## Gimpy00Wang (May 15, 2003)

No new QMail versions in a while so you likely tried the current version. My recommendation of QMail comes from using it on FreeBSD and RedHat. I don't have any experience with it on osx, but my guess is that it should work fine (at least...it should compile). QMail's configuration is where things sometimes get tricky.

Below I've included a quick install script I use.

- G!mpy


```
#!/bin/sh

# welcome
cat << EOM

                                               
   _|_|       _|      _|              _|   _|  
 _|    _|     _|_|  _|_|     _|_|_|        _|  
 _|  _|_|     _|  _|  _|   _|    _|   _|   _|  
 _|    _|     _|      _|   _|    _|   _|   _|  
   _|_|  _|   _|      _|     _|_|_|   _|   _|  

EOM

# variables
SHOST=`hostname | cut -d . -f 1`
PAKDIR=`pwd`
SKEL="$PAKDIR/skel"

# untar everything
echo "Unpacking files..."
sleep 2
ls -l *.gz | awk '{print $9}' | xargs -n 1 tar -xvzf

# tcpserver
echo "Installing ucspi-tcp-0.88..."
sleep 2
cd $PAKDIR/ucspi-tcp-0.88/
make
make setup check

# ezmlm
echo "Installing ezmlm-0.53..."
sleep 2
cd $PAKDIR/ezmlm-0.53/
make
make man
make setup

# vpopmail
echo "Installing vpopmail-5.2.1..."
sleep 2
pw groupadd vchkpw -g 89
pw useradd vpopmail -g vchkpw -u 89 -d /var/vpopmail
mkdir /var/vpopmail
chown -R vpopmail.vchkpw /var/vpopmail
cd $PAKDIR/vpopmail-5.2.1/
./configure --enable-roaming-users=y
make
make install-strip

# qmailadmin
echo "Installing qmailadmin-1.0.6..."
sleep 2
cd $PAKDIR/qmailadmin-1.0.6/
./configure
make
make install-strip

# misc
echo "Performing misc configuration..."
sleep 2
cp $SKEL/rc /var/qmail/
cp $SKEL/smtp.sh /var/qmail/bin/
chmod 750 /var/qmail/bin/smtp.sh
sed 's/_SHOST_/'$SHOST'/g' $SKEL/pop3.sh > /var/qmail/bin/pop3.sh
chmod 750 /var/qmail/bin/pop3.sh
cd /var/vpopmail/etc/
tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
echo 'PATH="$PATH:/var/qmail/bin:/var/vpopmail/bin"; export PATH;' >> /root/.profile

# quick & dirty fix
cd /var/qmail/control
for FOO in `ls -al | awk '{ print $9 }'`
{
  echo `hostname` > $FOO
}

# attention
cat << EOF

              !!! ATTENTION !!!

The QMail installation has completed. Please be sure
to review the installation and make sure things went
as planned. <ake sure /var/qmail/control/ looks good.

              !!! ATTENTION !!!

EOF
```



> _Originally posted by wyvern _
> *Postfix also has a lot of fans.
> 
> I tried about 6 months ago to get qmail working on OS X. I never succeeded, and I consider myself fairly unix-savvy. Perhaps it's better now.
> ...


----------



## Gimpy00Wang (May 15, 2003)

Here's the pop3.sh:


```
#!/bin/sh
# This starts qmail-pop3d using tcpserver

env - PATH="/var/qmail/bin:/usr/local/bin" \
tcpserver -H -R 0 pop3 \
/var/qmail/bin/qmail-popup _SHOST_.domain.com \
/var/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir &
```

smtp.sh:


```
#!/bin/sh

echo Starting qmail-smtpd...
/usr/local/bin/tcpserver -x /var/vpopmail/etc/tcp.smtp.cdb -u 82 -g 81 0 \
smtp /var/qmail/bin/qmail-smtpd \
2>&1 | /var/qmail/bin/splogger smtpd &
```

...and my rc...


```
#!/bin/sh

# Using splogger to send the log through syslog.
# Using qmail-local to deliver messages to Maildir format by default

case "$1" in
start)
        exec env - PATH="/var/qmail/bin:$PATH" \
                qmail-start ./Maildir/ splogger qmail&
                /var/qmail/bin/pop3.sh
                /var/qmail/bin/smtp.sh
        exit 0
        ;;
stop)
        exec killall qmail-send
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        exit 64
        ;;
esac
```

- G!mpy


----------



## Gimpy00Wang (May 15, 2003)

.


----------



## moh83 (Aug 17, 2006)

Gimpy00Wang said:


> I have implemented smtp auth with QMail, but not with Sendmail. We moved away from Sendmail a little over a year ago after getting tired of its limitations and vulnerabilities. If you can, I would strongly suggest checking out QMail. If you're used to Sendmail, QMail will seem a little odd, but it's super-stable and well worth the migration.
> 
> - G!mpy



hi, in my organization we need to realy mail from our mail server to isp mail server (smtp.xyz.com) using a username and password, can u tell me how to do this with Qmail, or plz direct me to some useful links.
  i have been trying this for a long time, but ,,,,,,.........couldn't find ny god solution.
thanks
Mohit


----------

