RE: cyrus autocreate
"Paul Wolstenholme" <paul-lVtV+q5f9oyCpuvbwG9LCbDks+cytr/[email protected]>
| Newsgroups | gmane.comp.isp.ispman.devel |
|---|---|
| Message-ID | <[email protected]> |
Snip...
>>Alternatively, I could continue to use the auto create patch by
>>changing the processes called=2E Instead of calling the
>createMailbox
>>and setMailboxQuota, I think I could add a process which logs in as
>>the new user and then call the setMailboxQuota=2E I like this later
>>approach=2E I believe I could make it backwards compatible if I
>added
>>another configuration variable=2E Something like
>"useCyrusAutoCreate"=2E
>>If the variable is not set, then in does what it does now (create
>>mailbox, set quota)=2E If it is set, it calls login and set quota=2E
>>
I finished implementing this on my system. It allows me to take
advantage of the autocreate patch for cyrus. I haven't tested it very
thoroughly yet but it seems to work so far (I'm sure something will
bite me in the ass later though).
A few details for those who may be interested:
1. create a login_user_cyrus.lib modeled after the other cyrus libs:
$ispman->{'imap'} = ISPMan::IMAP->new();
$ispman->{'imap'}->login_logout($user, $password, $hostname);
2. Created a new login_logout function in ispman/lib/ISPMan/IMAP.pm
sub login_logout {
my $self = shift;
my $user = shift;
my $password = shift;
my $server = shift;
# Calling the connect function will cause autocreate to make the
subfolders defined in /etc/imapd.conf
my $imap = $self->connect($server, $user, $password);
log_event ("Trying to login to imap $server as $user");
if ($self->close($server)) {
log_event("$user logged in and out successfully");
return 1;
}
return 0;
}
3. Modified the connect function in the above file so that it can
take two optional paramaters (username, and password) so that a user
other than the admin can connect.
4. Create a userLogin function in the bin/ispman-agent
/Paul
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php