Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 10:28:03 -0500
From:      "Robin P. Blanchard" <Robin_Blanchard@gactr.uga.edu>
To:        stable@freebsd.org
Cc:        simon@surf.org.uk, hetzels@westbend.net
Subject:   Re: cyrus LDAP woes
Message-ID:  <3C596283.8FC43958@gactr.uga.edu>
References:  <3C595050.18233273@gactr.uga.edu> <1012487592.1925.229.camel@madoka.hollowhill.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C596283.8FC43958>