Perl module interface

matsu matsu at com56.com
Sun Sep 22 11:42:53 EDT 2002


I tried the source you gave me.
But authentication is fail.

So I rewrite that source a little. please see the attachment file.

If execute attachement file.
----------------------
$ perl cyrus_add.pl testest
Authentication start
Login failed: user not found at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Cyrus/IMAP/Admin.pm line 78
Creating user.testest on
Please login first at dou.pl line 32.
$ 
----------------------
There is a waiting time after "Authentication start" message,

And I set up syslog like this, and take logs detail. in syslog.conf
-----------------------
local6.debug                                            /var/log/imapd.log
auth.debug                                              /var/log/imapd.log
-----------------------


In /var/log/imapd.log, When execute that script, first 3lines are appeared,
and when script exit, the last line is appeared.
------------------------
Sep 23 00:37:55 rnavi master[15910]: about to exec /usr/cyrus/bin/imapd
Sep 23 00:37:55 rnavi service-imap[15910]: executed
Sep 23 00:37:55 rnavi imapd[15910]: accepted connection
Sep 23 00:37:58 rnavi master[10538]: process 15910 exited, status 0
------------------------


why,,,,,?

Sure thing, I can login by this command.
$ cyradm --user foo localhost


Thanks

"Mark Davis" <MDRobot at team.nwn.de> wrote @2002/09/22 5:36:10 title Re: Perl module interface :
> Hi.
> 
> Try it like that:
> 
> ==================================================
> #!/usr/bin/perl
> 
> use Cyrus::IMAP::Admin;
> 
> $server = "localhost";
> $cyrus_admin_username = "admin_username";
> $cyrus_admin_password = "admin_password";
> 
> $mbox = shift or die "usage: make_mailbox.pl <username> .";
> $mbox = "user.$mbox";
> 
> 
> # Authenticate
> my $cyrus = Cyrus::IMAP::Admin->new($server);
> $cyrus->authenticate(-mechanism => 'login', -user => $cyrus_admin_username, -password
> => $cyrus_admin_password);
> die $cyrus->error if $cyrus->error;
> 
> # Create the account
> print "Creating $mbox on \n";
> $cyrus->createmailbox($mbox);
> warn $cyrus->error if $cyrus->error;
> 
> # Finished :)
> ==================================================
> 
> 
> Greets
> Mark
<snip>


---------------------------------
Yuki Matsukura <matsu at com56.com>

http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xC2E9FE2A
---------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus_add.pl
Type: application/octet-stream
Size: 684 bytes
Desc: not available
Url : https://lists.andrew.cmu.edu/mailman/private/info-cyrus/attachments/20020923/d6f25a50/cyrus_add.obj


More information about the Info-cyrus mailing list