Subject: SASL or bust
To: None <netbsd-help@netbsd.org>
From: Zafer Aydogan <zafer@gmx.org>
List: netbsd-help
Date: 03/28/2004 22:33:09
hi group,

I'm out of GAS. I give up. 
I wanted to set up sendmail as a client using smpt auth on my smart host.
Aim is that all mail is delivered to the smart host, which needed to be
authenticated via smpt auth (plain or login).

I followed the manual. 
I compiled & installed cyrus-sasl
I even compiled berkeley-db. 

bash-2.05b# saslauthd -v
saslauthd 2.1.18
authentication mechanisms: getpwent rimap

bash-2.05b# cat /usr/lib/sasl2/Sendmail.conf
mech_list: PLAIN LOGIN
pwcheck_method: passwd

bash-2.05b# saslauthd -a getpwent
bash-2.05b# tail /var/log/authlog
Mar 28 22:04:09 beta saslauthd[29300]: detach_tty      : master pid is:
29300
Mar 28 22:04:09 beta saslauthd[29300]: ipc_init        : listening on
socket: /var/state/saslauthd/mux

Everything seems to be fine.

then, I build sendmail from source.
This is my site.config.m4:

APPENDDEF(`conf_sendmail_ENVDEF', `-I/usr/include/sasl2')
APPENDDEF(`conf_sendmail_ENVDEF', `-DSASL=2')
APPENDDEF(`confLIBDIRS', `-L/usr/lib')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')
APPENDDEF(`confMAPDEF', `-DNEWDB')

"sh Build" runs without errors.

this is my .mc:

# $NetBSD: netbsd-proto.mc,v 1.9.2.1 2002/11/24 15:54:27 tron Exp $
divert(-1)
include(`../m4/cf.m4')
VERSIONID(`@(#)netbsd-proto.mc  $Revision: 1.9.2.1 $')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
FEATURE(genericstable,DATABASE_MAP_TYPE` -o
'MAIL_SETTINGS_DIR`genericstable')
FEATURE(mailertable,  DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`mailertable')
FEATURE(virtusertable,DATABASE_MAP_TYPE` -o
'MAIL_SETTINGS_DIR`virtusertable')
FEATURE(domaintable,  DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`domaintable')
FEATURE(`access_db',`hash -T<TMPF> /etc/mail/access.db')dnl
FEATURE(`redirect')
define(`SMART_HOST',`my.smarthost.com')dnl
FEATURE(`accept_unqualified_senders')dnl
define(`SMTP_MAILER_FLAGS',`e')dnl
define(`confCON_EXPENSIVE',`True')dnl
define(`confDEF_CHAR_SET',`ISO-8859-1')dnl
FEATURE(`authinfo')dnl
define(`confAUTH_MECHANISMS',`LOGIN PLAIN')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
MAILER(local)dnl
MAILER(smtp)dnl

m4 (with gm4 (gnu m4)) builds fine.

bash-2.05b# sendmail -d0.1 -bv root
Version 8.12.11
 Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MIME7TO8 MIME8TO7
                NAMED_BIND NETINET NETISO NETUNIX NEWDB NIS PIPELINING
SASLv2
                SCANF USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = beta
  (canonical domain name) $j = beta.dot.net
         (subdomain name) $m = dot.net
              (node name) $k = beta.dot.net
========================================================

root... deliverable: mailer local, user root

my authinfo:
bash-2.05b# cat /etc/mail/authinfo
AuthInfo:my.smarthost.com "U:foo" "I:foo" "P:secret" "M:PLAIN"

bash-2.05b#makemap hash /etc/mail/authinfo.db < /etc/mail/authinfo

starting sendmail....
bash-2.05b# /usr/sbin/sendmail -bd -q5m

bash-2.05b# tail -f /var/log/authlog
Mar 28 22:02:44 beta saslauthd[16855]: server_exit     : master exited:
16855
Mar 28 22:04:09 beta saslauthd[29300]: detach_tty      : master pid is:
29300
Mar 28 22:04:09 beta saslauthd[29300]: ipc_init        : listening on
socket: /var/state/saslauthd/mux
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: libsasldb.la
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: libcrammd5.la
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: libdigestmd5.la
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: libotp.la
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: libplain.la
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: libanonymous.la
Mar 28 22:17:13 beta sendmail[10988]: Could not find a dlname line in .la
file: liblogin.la

Whats that?
bash-2.05b# ls -l /usr/lib/sasl2/
total 2112
-rw-r--r--  1 root  wheel      47 Mar 28 22:03 Sendmail.conf
-rw-r--r--  1 root  wheel  107944 Mar 28 21:18 libanonymous.a
-rwxr-xr-x  1 root  wheel     627 Mar 28 21:18 libanonymous.la
-rw-r--r--  1 root  wheel  115030 Mar 28 21:18 libcrammd5.a
-rwxr-xr-x  1 root  wheel     621 Mar 28 21:18 libcrammd5.la
-rw-r--r--  1 root  wheel  179240 Mar 28 21:18 libdigestmd5.a
-rwxr-xr-x  1 root  wheel     636 Mar 28 21:18 libdigestmd5.la
-rw-r--r--  1 root  wheel  109120 Mar 28 21:18 liblogin.a
-rwxr-xr-x  1 root  wheel     623 Mar 28 21:18 liblogin.la
-rw-r--r--  1 root  wheel  187364 Mar 28 21:18 libotp.a
-rwxr-xr-x  1 root  wheel     618 Mar 28 21:18 libotp.la
-rw-r--r--  1 root  wheel  108576 Mar 28 21:18 libplain.a
-rwxr-xr-x  1 root  wheel     623 Mar 28 21:18 libplain.la
-rw-r--r--  1 root  wheel  173422 Mar 28 21:18 libsasldb.a
-rwxr-xr-x  1 root  wheel     627 Mar 28 21:18 libsasldb.la


bash-2.05b# telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 beta.dot.net ESMTP Sendmail 8.12.11/8.12.11; Sun, 28 Mar 2004 22:18:46
+0200 (CEST)
EHLO localhost
250-beta.dot.net Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP

Am I missing AUTH ??

bash-2.05b# tail /var/log/maillog
Mar 28 22:17:13 beta sendmail[2916]: starting daemon (8.12.11):
SMTP+queueing@00:05:00
Mar 28 22:20:04 beta sendmail[24738]: i2SKIkMc024738: localhost [127.0.0.1]
did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
bash-2.05b#

And I get 
Mar 28 19:39:33 beta sendmail[27891]: AUTH warning: no mechanisms
I'm stuck.

So, whats up, dude...
Thanks for help.

System:
bash-2.05b# uname -a
NetBSD beta.dot.net 1.6ZK NetBSD 1.6ZK (ZAMP) #0: Thu Mar 18 11:04:00 CET
2004  zafer@ftp2.dot.net:/usr/src/sys/arch/i386/compile/ZAMP i386