* on the Tue, Jul 03, 2007 at 02:45:05PM -0500, craig jackson wrote:
> Is there a way to have an administrative user that can authenticate to
> all accounts with his single user name and password? Using
> Courier-imap 4.1.1 and Courier-authlib.58 I would like this because
> it would facilitate mailbox synchronization across server types for
> which we are using Imapsync.
I recently had a similar problem. In the end, I solved it by adding an
extra authentication method (userdb) and made it so for every user that
could access via imap using pam authentication there was an entry with a
modified username and a "super password" in the userdb
So given user "mike" with an unknown password, the userdb would allow
access to this account with username "migrations-mike" and a known super
password.
I installed the courier-authlib-userdb rpm, and then updated authdaemonrc
by changing:
authmodulelist="authpam"
To:
authmodulelist="authuserdb authpam"
The userdb is generated on a daily db from the /etc/passwd file using
the small perl script below. The paths may be different depending on
what system you're using (RHE, in this example).
-----------------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
### Config
my $super_password = 'The super password';
my $salt = '$1$h3tdl2c1';
###
my $hash = crypt( $super_password, $salt, );
my $new_userdb = '';
open my $in, '/usr/sbin/pw2userdb |' or die $!;
while( <$in> ){
chomp( my $line = $_ );
$line = "migrations-$line";
$line =~ s/(\|systempw=)\*(\|)/$1$hash$2/;
$new_userdb .= "$line\n";
}
close $in;
open my $out, '>', '/etc/authlib/userdb' or die $!;
print $out $new_userdb;
close $out;
chmod( 0700, '/etc/authlib/userdb' );
`/usr/sbin/makeuserdb`;
-----------------------------------------------------------------------
I stuck authuserdb before authpam in that list because pam on my system
delays for a few seconds if auth fails.
Mike
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap