From owner-freebsd-isp Fri Nov 29 8:55:29 2002 Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADD1437B401 for ; Fri, 29 Nov 2002 08:55:25 -0800 (PST) Received: from fork.computel.sk (fork.computel.sk [195.28.96.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 069BB43EBE for ; Fri, 29 Nov 2002 08:55:21 -0800 (PST) (envelope-from lk@tempest.sk) Received: from lk.tempest.sk (lk.tempest.sk [195.28.100.47]) by fork.computel.sk with ESMTP id gATGt4K28243; Fri, 29 Nov 2002 17:55:04 +0100 Received: from lk.tempest.sk (localhost [127.0.0.1]) by lk.tempest.sk (8.12.5/8.12.5) with ESMTP id gATGswWJ094661; Fri, 29 Nov 2002 17:54:58 +0100 (CET) (envelope-from koren@lk.tempest.sk) Received: (from koren@localhost) by lk.tempest.sk (8.12.5/8.12.5/Submit) id gATGsw4F094658; Fri, 29 Nov 2002 17:54:58 +0100 (CET) Date: Fri, 29 Nov 2002 17:54:58 +0100 (CET) Message-Id: <200211291654.gATGsw4F094658@lk.tempest.sk> From: Ludo Koren To: erlis@engineer.com Cc: freebsd-isp@FreeBSD.ORG In-reply-to: <20021129102242.GB91480@engineer.com> (message from Andrew Scherbachenko on Fri, 29 Nov 2002 12:22:42 +0200) Subject: Re: standalone pop3 daemon Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > Qpopper can work with LDAP via PAM but it require fake records > in /etc/master.passwd 8-( Does anyone know subj that can work > with LDAP without any additional requirements like records in > /etc/master.passwd or so? I did it a while ago. Try to apply the following patches. I assume, you have sources of sendmail in /usr/src/contrib/sendmail and sendmail library in /usr/obj/usr/src/lib/libsm. Regards, ludo *** Makefile.patched Thu Oct 17 12:20:46 2002 --- Makefile Thu Oct 17 11:56:39 2002 *************** *** 151,157 **** ${common_dir}/string_util.h ! CFLAGS = -O -pipe -freg-struct-return CDEFS = OS_DEFS = -DSETPROCTITLE -DFREEBSD -DUNIX DEFS = -DHAVE_CONFIG_H --- 151,157 ---- ${common_dir}/string_util.h ! CFLAGS = -O -pipe -freg-struct-return -I/usr/src/contrib/sendmail/include -I/usr/obj/usr/src/lib/libsm CDEFS = OS_DEFS = -DSETPROCTITLE -DFREEBSD -DUNIX DEFS = -DHAVE_CONFIG_H *************** *** 161,167 **** NETWORK_LIBS = KERBEROS_LIBS = DBM_LIBS = ! LIBS = -lmd -lutil -L/usr/local/lib -lpam -L/usr/lib -lssl -lcrypto AR_FLAG = -r RANLIB_CMD = --- 161,167 ---- NETWORK_LIBS = KERBEROS_LIBS = DBM_LIBS = ! LIBS = -lmd -lutil -L/usr/local/lib -lpam -L/usr/lib -lssl -lcrypto /usr/obj/usr/src/lib/libsm/libsm.a -lldap -llber AR_FLAG = -r RANLIB_CMD = ------------------ cut here ---------------------------------- *** pop_pass.c.patched Thu Oct 17 10:54:32 2002 --- pop_pass.c Thu Oct 17 12:09:06 2002 *************** *** 135,140 **** --- 135,141 ---- #endif /* KERBEROS */ #include "snprintf.h" + #include #define SLEEP_SECONDS 10 *************** *** 440,445 **** --- 441,447 ---- int pamerror = 0; int erc = 0; const char *errmsg = NULL; + SM_MBDB_T user; /* * Let conv function access POP structure *************** *** 479,484 **** --- 481,492 ---- return ( pop_msg ( p, POP_FAILURE, HERE, GP_ERRSTRING, p->user, errmsg, erc ) ); } + sm_mbdb_initialize ("ldap"); + sm_mbdb_lookup ( p->user, &user ); + (&p->pw)->pw_name = strdup ( p->user ); + (&p->pw)->pw_uid = user.mbdb_uid; + (&p->pw)->pw_gid = user.mbdb_gid; + sm_mbdb_terminate (); pamerror = pam_acct_mgmt ( pamh, 0 ); DEBUG_LOG1 ( p, "pam_acct_mgmt returned %i", pamerror ); if ( pamerror != PAM_SUCCESS ) { *************** *** 1275,1280 **** --- 1283,1289 ---- *secretkey = '\0'; #endif /* SECURENISPLUS */ + SM_MBDB_T user; /* * Is the user not authorized to use POP? *************** *** 1296,1301 **** --- 1305,1317 ---- * Verify user known by system. */ pwp = &p->pw; + sm_mbdb_initialize ("ldap"); + sm_mbdb_lookup ( p->user, &user ); + pwp->pw_name = strdup ( p->user ); + pwp->pw_uid = user.mbdb_uid; + pwp->pw_gid = user.mbdb_gid; + sm_mbdb_terminate (); + if ( pwp->pw_name == NULL ) { DEBUG_LOG1 ( p, "User %.128s not known by system", p->user ); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message