Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.62 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. my $adminuser = "cyrus"; # Cyrus admin user
  3. my $adminpw = "traf"; # Cyrus admin password
  4. my $server = "localhost";
  5.  
  6.  
  7. use Cyrus::IMAP::Admin;
  8.  
  9. $imap = Cyrus::IMAP::Admin->new($server) || die "Unable to connect to $server";
  10.  
  11. if (! $imap) {
  12.     die "Error creating IMAP connection object\n";
  13. }
  14.  
  15. $imap->authenticate(-user => $adminuser,
  16.         -password => $adminpw,
  17.         ) || die "Authentication Failure";
  18.  
  19. if ($imap->error) {
  20.     die $imap->error;
  21. }
  22.  
  23. print "Successfully connected to IMAP server.\n";
  24.  
  25. open F, $ARGV[0];
  26. while (defined(my $row = <F>)) {
  27.     $imap->create("user.$row");
  28. }
  29. close F;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement