IMAP::Admin

IMAP::Admin is a Perl module for basic IMAP server administration.
Download

IMAP::Admin Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Eric Estabrooks
  • Publisher web site:
  • http://search.cpan.org/~eestabroo/Crypt-HCE_SHA-0.70/HCE_SHA.pm

IMAP::Admin Tags


IMAP::Admin Description

IMAP::Admin is a Perl module for basic IMAP server administration. IMAP::Admin is a Perl module for basic IMAP server administration.SYNOPSIS use IMAP::Admin; $imap = IMAP::Admin->new('Server' => 'name.of.server.com', 'Login' => 'login_of_imap_administrator', 'Password' => 'password_of_imap_adminstrator', 'Port' => port# (143 is default), 'Separator' => ".", # default is a period 'CRAM' => 1, # off by default, can be 0,1,2 'SSL' => 1, # off by default # and any of the SSL_ options from IO::Socket::SSL ); $err = $imap->create("user.bob"); if ($err != 0) { print "$imap->{'Error'}n"; } if ($err != 0) { print $imap->error; } $err = $imap->create("user.bob", "green"); $err = $imap->delete("user.bob"); $err = $imap->h_delete("user.bob"); $err = $imap->subscribe("user.bob"); $err = $imap->unsubscribe("user.bob"); $err = $imap->rename("bboard", "newbboard"); @quota = $imap->get_quotaroot("user.bob"); @quota = $imap->get_quota("user.bob"); $err = $imap->set_quota("user.bob", 10000); @acl = $imap->get_acl("user.bob"); ?l = $imap->get_acl("user.bob"); $err = $imap->set_acl("user.bob", "admin", "lrswipdca", "joe", "lrs"); $err = $imap->delete_acl("user.bob", "joe", "admin"); @list = $imap->list("user.bob"); @list = $imap->list("user.b*"); $imap->{'Capability'} # this contains the Capabilities reply from the IMAP server $imap->close; # close open imap connectionIMAP::Admin provides basic IMAP server adminstration. It provides functions for creating and deleting mailboxes and setting various information such as quotas and access rights.It's interface should, in theory, work with any RFC compliant IMAP server, but I currently have only tested it against Carnegie Mellon University's Cyrus IMAP and Mirapoint's IMAP servers. It does a CAPABILITY check for specific extensions to see if they are supported.Operationally it opens a socket connection to the IMAP server and logs in with the supplied login and password. You then can call any of the functions to perform their associated operation.Separator on the new call is the hiearchical separator used by the imap server. It is defaulted to a period ("/" might be another popular one).CRAM on the new call will attempt to use CRAM-MD5 as the login type of choice. A value of 0 means off, 1 means on, 2 means on with fallback to login. *Note* this options requires these perl modules: Digest::MD5, Digest::HMAC, MIME::Base64SSL on the new call will attempt to make an SSL connection to the imap server. It does not fallback to a regular connection if it fails. It is off by default. IO::Socket::SSL requires a ca certificate, a client certificate, and a client private key. By default these are in current_directory/certs, respectively named ca-cert.pem, client-cert.pem, and client-key.pem. The location of this can be overridden by setting SSL_ca_file, SSL_cert_file, and SSL_key_file (you'll probably want to also set SSL_ca_path).I generated my ca cert and ca key with openssl: openssl req -x509 -newkey rsa:1024 -keyout ca-key.pem -out ca-cert.pemI generated my client key and cert with openssl: openssl req -new -newkey rsa:1024 -keyout client-key.pem -out req.pem -nodes openssl x509 -CA ca-cert.pem -CAkey ca-key.pem -req -in req.pem -out client-cert.pem -addtrust clientAuth -days 600Setting up SSL Cyrus IMAP v 2.x (completely unofficial, but it worked for me) add these to your /etc/imapd.conf (remember to change /usr/local/cyrus/tls to wherever yours is) tls_ca_path: /usr/local/cyrus/tls tls_ca_file: /usr/local/cyrus/tls/ca-cert.pem tls_key_file: /usr/local/cyrus/tls/serv-key.pem tls_cert_file: /usr/local/cyrus/tls/serv-cert.pemFor my server key I used a self signed certificate: openssl req -x509 -newkey rsa:1024 -keyout serv-key.pem -out serv-cert.pem -nodes -extensions usr_cert (in openssl.cnf I have nsCertType set to server)I also added this to my /etc/cyrus.conf, it shouldn't strictly be necessary as clients that are RFC2595 compliant can issue a STARTTLS to initiate the secure layer, but currently IMAP::Admin doesn't issue this command (in SERVICES section): imap2 cmd="imapd -s" listen="simap" prefork=0where simap in /etc/services is: simap 993/tcp # IMAP over SSL Requirements: · Perl What's New in This Release: · Minor feature enhancements


IMAP::Admin Related Software