Re: Script admin problems

2001-08-09 Thread Matt Prigge

 Attempt two: Using module IMAP::Admin from
 IMAP-Admin-1.4.3 The test gives me the following
 error:
 IMAP::Admin [ initialize ]: try NO Login failed: authentication failure
 Again getting me past this error should allow me
 to complete the task.

IMAP::Admin has worked very well for me. Can you give an example of the code
youre trying to run that isnt working for you?

-matt




Re: Script admin problems

2001-08-09 Thread Warren Flemmer

With the package IMAP-Admin-1.4.3
running test.pl as follows:

[root@mail121 IMAP-Admin-1.4.3]# perl test.pl
1..14
ok 1
Remaining tests require a connection an imap server
Please enter the server and the admin user and password at the prompts
Enter server: localhost
Enter login: adm
Enter password:
Test using SSL(y/n)? n
IMAP::Admin [ initialize ]: try NO Login failed: authentication failure
[root@mail121 IMAP-Admin-1.4.3]#

The following script is the simplest example:

$imap=IMAP::Admin-new('Server'='localhost','Login'='adm','Password'='xxx
xx');
$err=$imap-create($mbx);
print error: $err\n;
$err=$imap-{'Error'};
print error: $err\n;
$imap-close;

will produce:

[root@mail121 /home]# ./cyrushelper
error: 1
error: IMAP::Admin [ initialize ]: try NO Login failed: authentication
failure

Could the use of pam-mysql have anything to do
the authentication failure. The passwords in the db
are encrypted with mysql password function. I can
log in from a client without any problems.

Regards

- Original Message -
From: Matt Prigge [EMAIL PROTECTED]
To: Warren Flemmer [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 11:01 AM
Subject: Re: Script admin problems


  Attempt two: Using module IMAP::Admin from
  IMAP-Admin-1.4.3 The test gives me the following
  error:
  IMAP::Admin [ initialize ]: try NO Login failed: authentication failure
  Again getting me past this error should allow me
  to complete the task.

 IMAP::Admin has worked very well for me. Can you give an example of the
code
 youre trying to run that isnt working for you?

 -matt




Re: Script admin problems

2001-08-09 Thread Darron Froese

On 8/9/01 2:34 AM, Warren Flemmer [EMAIL PROTECTED] wrote:

 Cyrus is working well with postfix using pam (mysql)
 for authentication. I now need to setup automated
 scripts to create mailboxes, set quotas etc. I have tried
 three different approaches each of which ending without
 successes so I now pass it to the group. I should point
 out that cyradm works without problems.

[SNIPPED]

 I would prefer to use one of the first two method with
 perl but will settle for tcl if I have no other choice. If there
 are any other approaches that may work I will give
 them a try. Someway of automating at least the
 mailbox creation is essential.

You can use a tool called expect to automate things like this.

Try this:

[darron@xavier darron]$ autoexpect cyradm localhost
autoexpect started, file is script.exp
Please enter your password:
localhost.localdomain lm
INBOX INBOX.admin   INBOX.logsINBOX.tech
INBOX.SentINBOX.educ8r  INBOX.mwj INBOX.test2
INBOX.Trash   INBOX.linux   INBOX.sutjav

localhost.localdomain quit
autoexpect done, file is script.exp

Take a look at script.exp - it's a complete copy of everything you've done
and can be modified to do whatever you want it to do.

I've got an expect script that automatically creates the mailbox, sets
permissions on it properly and sets a quota - it works great for us.
-- 
Darron
[EMAIL PROTECTED]




Re: Script admin problems

2001-08-09 Thread Alain Turbide

Since IMAP::Admin requires the LOGIN auth method to be compiled into SASL,
that might be the problem.  You need LOGIN auth for that.
The best check would be to telnet to the imap port as suggested by Jules.
Alain

- Original Message -
From: Jules Agee [EMAIL PROTECTED]
To: Warren Flemmer [EMAIL PROTECTED]
Cc: info-cyrus [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 2:34 PM
Subject: Re: Script admin problems


 How strange. if I remember correctly, the IMAP::Admin module does
 everything through an IMAP connection using standard RFC IMAP
 commands, just like cyradm does. So if you're using the same login and
 password with cyradm as you're using with your perl script, and cyradm
 works, the problem would have to be in your script or in IMAP::Admin.

 hmmm. this module works fine for me... the only thing I can think of
 is (pretty unlikely) if you've got a literal backslash or single quote
 in the password, perl might screw up the password it's passing to the
 IMAP::Admin module...

 To confirm that there's nothing wrong with your Cyrus configuration,
 and that cyradm isn't covering up or compensating for some error
 message, you might try typing the stuff on the lines marked by 'YOU':

 YOU: $ telnet localhost 143
   Connected to {hostname}.
   Escape character is '^]'.
   * OK {hostname} Cyrus IMAP4 v2.0.15 server ready.
 YOU: . login adm XX
   . OK User logged in
 YOU: . create user.testmailbox
   . OK Completed
 YOU: . setacl user.testmailbox adm lrswipcda
   . OK Completed
 YOU: . delete user.testmailbox
   . OK Completed
 YOU: . logout
   * BYE LOGOUT received
   . OK Completed
   Connection closed by foreign host.


 Warren Flemmer wrote:

  With the package IMAP-Admin-1.4.3
  running test.pl as follows:
 
  [root@mail121 IMAP-Admin-1.4.3]# perl test.pl
  1..14
  ok 1
  Remaining tests require a connection an imap server
  Please enter the server and the admin user and password at the prompts
  Enter server: localhost
  Enter login: adm
  Enter password:
  Test using SSL(y/n)? n
  IMAP::Admin [ initialize ]: try NO Login failed: authentication failure
  [root@mail121 IMAP-Admin-1.4.3]#
 
  The following script is the simplest example:
 
 
$imap=IMAP::Admin-new('Server'='localhost','Login'='adm','Password'='xxx
  xx');
  $err=$imap-create($mbx);
  print error: $err\n;
  $err=$imap-{'Error'};
  print error: $err\n;
  $imap-close;
 
  will produce:
 
  [root@mail121 /home]# ./cyrushelper
  error: 1
  error: IMAP::Admin [ initialize ]: try NO Login failed: authentication
  failure
 
  Could the use of pam-mysql have anything to do
  the authentication failure. The passwords in the db
  are encrypted with mysql password function. I can
  log in from a client without any problems.
 
  Regards
 
  - Original Message -
  From: Matt Prigge [EMAIL PROTECTED]
  To: Warren Flemmer [EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: Thursday, August 09, 2001 11:01 AM
  Subject: Re: Script admin problems
 
 
 
 Attempt two: Using module IMAP::Admin from
 IMAP-Admin-1.4.3 The test gives me the following
 error:
 IMAP::Admin [ initialize ]: try NO Login failed: authentication failure
 Again getting me past this error should allow me
 to complete the task.
 
 IMAP::Admin has worked very well for me. Can you give an example of the
 
  code
 
 youre trying to run that isnt working for you?
 
 -matt
 
 
 



 --
 Jules Agee
 System Administrator
 Pacific Coast Feather Co.
 [EMAIL PROTECTED]  x284






Re: Script admin problems

2001-08-09 Thread Jeremy Howard

Jules Agee wrote:
 How strange. if I remember correctly, the IMAP::Admin module does 
 everything through an IMAP connection using standard RFC IMAP 
 commands, just like cyradm does. So if you're using the same login and 
 password with cyradm as you're using with your perl script, and cyradm 
 works, the problem would have to be in your script or in IMAP::Admin.
 
Maybe it's the authentication mechanism being selected incorrectly. Try
  cyradm localhost -u admin --auth MECH
replacing MECH with the mechanism you use.