The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Zimbra::Expect - Remote control zmprov and zmmailbox

SYNOPSIS

 use Zimbra::Expect::ZmXXX;
 my $box = Zimbra::Expect::ZmXXXX->new(verbose=>1);
 my %folder;
 my $old = 'Saved';
 my $new = 'Received';
 for my $line (split /\n/, $box->cmd('getAllFolders')){
    $line =~ m{^\s*\S+\s+mess\s+\d+\s+\d+\s+(/.+)} && do {
       $folder{$1} = 1;
       next;
    };
 }
 if (not $folder{$to}){
    $box->act('renameFolder '.$from.' '.$to);
    next;
 }
 

DESCRIPTION

Interactively use a zimbra cli command. The following methods are provided:

new(verbose=>$a,noaction=>$b,debug=>$c)

Launch the zimbra command. In debug mode the response from the zm* command will also be displayed.

cmd($cmd)

Will execute a command and return the output from the command

act($cmd)

Works exactly like cmd but when the instance has been created with the noaction flag, then the command will NOT be executed.

COPYRIGHT

Copyright (c) 2017 by OETIKER+PARTNER AG. All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

AUTHOR

Tobias Oetiker <tobi@oetiker.ch>

HISTORY

 2017-05-16 to Initial Version