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?