Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How do I pass the password to Cyrus::IMAP::Shell?

by Tomte (Priest)
on Apr 13, 2006 at 16:27 UTC ( [id://543143]=note: print w/replies, xml ) Need Help??


in reply to How do I pass the password to Cyrus::IMAP::Shell?

try the login command, see the documentation for the module.

Otherwise, if you don't use the shell interactivly, why not use Cyrus::IMAP::Admin and do the full monty directly in perl?

use Cyrus::IMAP::Admin; # # assuming all necessary variables have been declared and filled accor +dingly: # my $client = Cyrus::IMAP::Admin->new($host); my $auth = { -mechanism => 'login', -service => 'imap', -authz => $admin, -user => $admin, -minssf => 0, -maxssf => 10000, -password => $admin_pass, }; $client->authenticate( \%$auth); (print $client->{error} && return(1)) if $client->{error}; # e.g. create a new mailbox: $client->createmailbox('user.' . $mailuser);

regards,
tomte


An intellectual is someone whose mind watches itself.
-- Albert Camus

Replies are listed 'Best First'.
Re^2: How do I pass the password to Cyrus::IMAP::Shell?
by Anonymous Monk on Sep 29, 2009 at 10:21 UTC
    Excellent script! I only had to remove the '\%' token in the authenticate call, and it worked like a charm. Any idea on how to set quota to that newly created mailbox? My guesses were all wrong! ;-) Thanks anyway! Juli
      Juli,

      Any idea on how to set quota to that newly created mailbox? My guesses were all wrong! ;-)

      The perldoc suggests

      # setting a 256MB quota $client->setquota('user.name@domain', 'STORAGE', 262144);
      Unfortunately I can't test this right now - but I'm sure other monks can help, if you post what you unsuccessfully tried.

      regards,
      tomte


      An intellectual is someone whose mind watches itself.
      -- Albert Camus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://543143]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found