4 messages in net.sourceforge.lists.courier-usersRe: [courier-users] mapping login rea...
FromSent OnAttachments
Paul ChvostekNov 6, 2001 9:17 pm 
Anand BuddhdevNov 7, 2001 12:12 am 
Paul ChvostekNov 11, 2001 11:06 pm 
Anand BuddhdevNov 23, 2001 5:18 am 
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:Re: [courier-users] mapping login realms to username prefixesActions...
From:Anand Buddhdev (ar@anand.org)
Date:Nov 23, 2001 5:18:41 am
List:net.sourceforge.lists.courier-users

On Mon, Nov 12, 2001 at 02:04:51AM -0500, Paul Chvostek wrote:

Sorry for the late reply. Just catching up with my emails.

If you look carefully at the courier imap startup script, you'll notice something like this:

couriertcpd [options] /path/to/imaplogin authmodules /path/to/imapd Maildir

What you can do is insert your bit of code between the imaplogin and the authmodules; your code will convert the supplied username to the type found in your /etc/passwd file, and then run the authmodules, and eventually (after successful checking) run the imapd process itself.

Thanks, Anand. That's certainly helpful, and I can get by doing what you suggest, but it's still less than optimal.

My old uw-imapd setup supports alternatives to the "@" character (which Netscape strips), so that users can log in as "bill%foo.org" or "foo-bill" to get access to the same account. So to support all of the existing user base, I'd have to make my userdb basically triple the size of my current password file. And I'd rather not do that.

I'd really like to implement logic like (in perl-style meta):

%realms = ("foo.org", "foo", "example.com", "ex"); if ( $imap_login_name =~ /[@%]/ ) { $login_lhs =~ s/[@%].*$//; $realm =~ s/^.*[@%]//; $prefix = $realms($realm); if ( $prefix eq "" ) { $local_username = $imap_login_name; } else { $local_username = $prefix . "-" . $login_lhs; } } else { $local_username = $imap_login_name; }

Is there a way to do this that doesn't require changing courier's source?