From owner-freebsd-stable Thu Jan 31 7:28:10 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mail.gactr.uga.edu (mail.gactr.uga.edu [128.192.37.21]) by hub.freebsd.org (Postfix) with SMTP id 145DE37B402 for ; Thu, 31 Jan 2002 07:28:05 -0800 (PST) Received: (qmail 7319 invoked from network); 31 Jan 2002 15:27:11 -0000 Received: from smtpgw.servers.nat (HELO smtpgw.gactr.uga.edu) ([10.10.10.25]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 31 Jan 2002 15:27:11 -0000 Received: (qmail 23290 invoked from network); 31 Jan 2002 15:28:03 -0000 Received: from unknown (HELO gactr.uga.edu) (10.10.100.125) by smtpgw.servers.nat with SMTP; 31 Jan 2002 15:28:03 -0000 Message-ID: <3C596283.8FC43958@gactr.uga.edu> Date: Thu, 31 Jan 2002 10:28:03 -0500 From: "Robin P. Blanchard" Organization: Georgia Center Information Technology X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: stable@freebsd.org Cc: simon@surf.org.uk, hetzels@westbend.net Subject: Re: cyrus LDAP woes References: <3C595050.18233273@gactr.uga.edu> <1012487592.1925.229.camel@madoka.hollowhill.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > openldap-2.0.21 > > qmail-ldap2-with_tls-1.03.20011001a > > cyrus-sasl-1.5.27_1 > > cyrus-imapd-2.0.16_2 > > > > 1) a user can successfully authenticate via sasl (to ldap) and get > > access to his mailbox (sasl/cyrus-imap are LDAP aware). > > 2) qmail successfully accepts mail, does ldap lookups (and can deliver > > to > > maildirs) > > 3) cyrus deliver dumps core when called by qmail. this core dump is > > owned by UID.GID in user's homedir (qmail properly looked up UID and GID > > and passed it on to cyrus deliver). > > 4) cyrus deliver successfully delivers when manually run via command > > line as > > root. > > 5) if user exists in /etc/passwd (defeating purpose of LDAP) situation > > #3 does *NOT* occur. > > From what you are saying deliver runs as the users uid if they are in > /etc/passwd and therefore is not allowed to post into mailboxes as > it should run as cyrus or root.... So qmail needs to stop > looking up userids... Apparently not the case... #0 main (argc=4, argv=0xbfbffad8) at deliver.c:276 276 return_path = p->pw_name; I kept staring at this output so I went at looked at the source code, around line 276: if (return_path == NULL) { uid_t me = getuid(); struct passwd *p = getpwuid(me); return_path = p->pw_name; } It seemed odd to me that return_path should be NULL, so I poked around and looked for other occurences of return_path to try to figure out how it gets set and found around lines 206: case 'f': return_path = optarg; break; Flag f? I added "-f" to the cyrus deliver wrapper script and mail magically gets delivered now. Oddly enough, on the old mail server (a linux box) which is running the same qmail/cyrus combo as this new (freebsd) box, the cyrus deliver wrapper script reads: /usr/local/cyrus/bin/deliver -a $USER $USER and gets called by qmail (via ldap) as: /var/qmail/bin/preline -f /usr/local/cyrus/bin/deliver -a $USER $USER and mail gets delivered. the new box requires the wrapper script to read: /usr/local/cyrus/bin/deliver -f -a $USER $USER and the /var/qmail/bin/preline -f from LDAP isn't necessary. Perhaps there's something minutely different in this freebsd build that causes the return_path coming from qmail ("/var/qmail/bin/preline -f") to be ignored, requiring it to be handled by cyrus deliver instead. And it seems strange that deliver would drop core when missing a return_path. Regardless, problem seems to be solved. Hopefully this info will be of use to other FreeBSD users of ldap-qmail-cyrus combo. -- ------------------------------------ Robin P. Blanchard IT Program Specialist Georgia Center for Continuing Ed. fon: 706.542.2404 fax: 706.542.6546 email: Robin_Blanchard@gactr.uga.edu ------------------------------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message