3 messages in net.sourceforge.lists.courier-users[courier-users] little feature to aut...
FromSent OnAttachments
Mirko ManeaJun 5, 2001 12:24 am.diff
Todd LyonsJun 5, 2001 8:10 am 
Mirko ManeaJun 5, 2001 11:36 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] little feature to authldaplib.cActions...
From:Mirko Manea (ma@arena.sci.univr.it)
Date:Jun 5, 2001 12:24:04 am
List:net.sourceforge.lists.courier-users
Attachments:

hi,

I've done a little patch to courier-imap-1.3.8.1 to allow a LDAP_HOMEDIR_PATH variable in authldaprc.

This is used as a prefix to what is extracted from the ldap attribute defined in LDAP_HOMEDIR.

This let me use the qmail's attribute mailMessageStore (which I defined as the username) to be prefixed by the path to where the maildirs are located, ie:

LDAP_HOMEDIR_PATH = /gfs/mailstore/ LDAP_HOMEDIR = mailMessageStore

will allow courier-imap to read user's mail from /gfs/mailstore/<user> where <user> is from ldap's mailMessageStore attribute.

Any comments?

Thanks, Mirko Manea

diff -u -r courier-imap-1.3.8.1/authlib/authldaplib.c
courier-imap-1.3.8.1.patched/authlib/authldaplib.c --- courier-imap-1.3.8.1/authlib/authldaplib.c Sun Apr 15 21:51:12 2001 +++ courier-imap-1.3.8.1.patched/authlib/authldaplib.c Mon May 28 20:20:25 2001 @@ -555,6 +555,8 @@ gid_t ag; int rc; char *quota=0; +const char *p; +char *homeDirPath=0;

memset(&auth, 0, sizeof(auth));

@@ -643,6 +645,12 @@ #endif /* Copy the directory and the password into struct */ copy_value(my_ldap_fp,entry,attributes[0],&homeDir, user); + if (read_env("LDAP_HOMEDIR_PATH", &p, "", 0, "")) { + homeDirPath=malloc(strlen(p) + strlen(homeDir)); + homeDirPath=p; + homeDir = strcat(homeDirPath, homeDir); + syslog(LOG_DAEMON|LOG_CRIT,"homeDirPath %s:\n",homeDirPath); + } if (attributes[1]) copy_value(my_ldap_fp,entry,attributes[1],&mailDir, user); copy_value(my_ldap_fp,entry,attributes[2],&cn, user); diff -u -r courier-imap-1.3.8.1/authlib/authldaprc
courier-imap-1.3.8.1.patched/authlib/authldaprc --- courier-imap-1.3.8.1/authlib/authldaprc Sun Dec 10 20:40:54 2000 +++ courier-imap-1.3.8.1.patched/authlib/authldaprc Mon May 28 18:54:44 2001 @@ -84,6 +84,12 @@

LDAP_HOMEDIR homeDirectory

+##NAME: LDAP_HOMEDIR_PATH +# +# The LDAP_HOMEDIR_PATH will be used as a prefix to LDAP_HOMEDIR (if defined) + +LDAP_HOMEDIR_PATH /gfs/mailstore/ + ##NAME: LDAP_MAILDIR:0 # # The MAILDIR attribute is OPTIONAL, and specifies the location of the diff -u -r courier-imap-1.3.8.1/courier-imap.spec
courier-imap-1.3.8.1.patched/courier-imap.spec --- courier-imap-1.3.8.1/courier-imap.spec Thu May 10 16:49:53 2001 +++ courier-imap-1.3.8.1.patched/courier-imap.spec Mon May 28 20:19:35 2001 @@ -61,11 +61,13 @@

%configure --localstatedir=%{_localstatedir} \ --with-authdaemonvar=%{authdaemondir} \ + --without-ipv6 \ + --enable-workarounds-for-imap-client-bugs %{?xflags: %{xflags}}

%build %{__make} -%{__make} check +#%{__make} check %install

%{__rm} -rf $RPM_BUILD_ROOT