Archive | Zimbra RSS feed for this section

Zimbra – Set MTA Trusted Networks From Command Line

To view trusted networks as the zimbra user: /opt/zimbra/bin/zmprov gs {servername} zimbraMtaMyNetworks To set trusted networks as the zimbra user do: /opt/zimbra/bin/zmprov ms {servername} zimbraMtaMyNetworks {space delimited list of address and/or cidr ranges} Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments [...]

To view trusted networks as the zimbra user:

/opt/zimbra/bin/zmprov gs {servername} zimbraMtaMyNetworks

To set trusted networks as the zimbra user do:

/opt/zimbra/bin/zmprov ms {servername} zimbraMtaMyNetworks {space delimited list of address and/or cidr ranges}
View Comments Continue Reading →

Export Zimbra mailbox

To export the mailbox for user@acme.com as a zip file use this command: /opt/zimbra/bin/zmmailbox -z -m user@acme.com getRestURL \ ‘//?fmt=zip&query=is:anywhere’ > user_at_acme_com.zip Here is the same as a tgz file: /opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL \ “//?fmt=tgz” > /tmp/account.tgz And here’s a restore of the tgz file: /opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL \ “//?fmt=tgz&resolve=reset” /tmp/account.tgz [...]

To export the mailbox for user@acme.com as a zip file use this command:

/opt/zimbra/bin/zmmailbox -z -m user@acme.com getRestURL \
‘//?fmt=zip&query=is:anywhere’ > user_at_acme_com.zip

Here is the same as a tgz file:

/opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL \
“//?fmt=tgz” > /tmp/account.tgz

And here’s a restore of the tgz file:

/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL \
“//?fmt=tgz&resolve=reset” /tmp/account.tgz

View Comments Continue Reading →

Zimbra Mailbox Size

Here’s a simple script that will provide a report on mailbox size for every mailbox on a Zimbra server. The report is sorted by box size in descending order: #!/usr/bin/perl my $all_accounts=`zmprov gaa`; my @accounts = split(/\n/,$all_accounts); my @sizes; foreach $account (@accounts) { my $mb_size=`zmmailbox -z -m $account gms`; chomp($mb_size); my $size; if ($mb_size =~ [...]

Here’s a simple script that will provide a report on mailbox size for every mailbox on a Zimbra server. The report is sorted by box size in descending order:

#!/usr/bin/perl

my $all_accounts=`zmprov gaa`;
my @accounts = split(/\n/,$all_accounts);

my @sizes;
foreach $account (@accounts) {
    my $mb_size=`zmmailbox -z -m $account gms`;
    chomp($mb_size);
    my $size;
    if ($mb_size =~ /(.+)\ GB/) {
        $size = $1 * 1024 * 1024;
    } elsif ($mb_size =~ /(.+)\ MB/) {
        $size = $1 * 1024;

    } elsif ($mb_size =~ /(.+)\ KB/) {

        $size = $1;
    } elsif ($mb_size =~ /(.+)\ B/) {
        $nsize = $1;
        if ($nsize eq 0) {
                $size = 0;
        } else {
                $size = abs(1024/$1);
        };
    };
    $next = scalar(@sizes);
    $sizes[$next][0] = $account;
    $sizes[$next][1] = $size;
};

@sizes = sort { $a->[1] <=> $b->[1] } @sizes;

my $D=`date +'%m/%d/%y %H:%M'`; chomp($D);

print "==========================================================\n";
print " Zimbra Mailbox Report\n";
print " \n";
print " All sizes in KB.";
print " Generated on: $D\n";
print "==========================================================\n";

for (my $i = $#sizes-1; $i >= 0; $i--) {
    printf ("%15.2f %s\n",$sizes[$i][1], $sizes[$i][0]);

};
View Comments Continue Reading →