Perl CPAN Shell Configuration on Solaris

You might be encounter problem installing per module as below.

cc: unrecognized option `-KPIC' cc: language ildoff not recognized cc: ReadKey.c: linker input file unused because linking not done
/usr/perl5/5.8.4/lib/sun4-solaris-64int/Config.pm
optimize='-O3' cccdlflags=' '

If you have below error while compiling.

gcc: language arch=v8 not recognized

Remove the following option founded in Config.pm file, usually there is 2 location.

-xarch=v8

GCC on Solaris

Zimbra Administration Tips Round-Up

Import Tarred Mailbox using following command line;

zmmailbox -z -m user@domain.com pru "//?fmt=tgz&resolve=reset" /tmp/filename.tgz or curl -k -u admin:PASSWORD --data-binary @/path/to/USER-account.tgz "https://MAILSTORE-FQDN:7071/service/home/USER@DOMAIN/?fmt=tgz&resolve=skip"

Export (Archive) mailbox into Tarred;

zmmailbox -z -m getRestURL "//?fmt=tgz" > /tmp/.tar.gz

Put Zimbra to maintenance mode : # zmprov md mydomain.com zimbraDomainStatus maintenance to reactivate : zmprov md mydomain.com zimbraDomainStatus active to get status; 

zmprov gd mydomain.com | grep -i zimbraDomainStatus

Empty mailbox;

zmmailbox -z -m ef /Inbox

How to Check Mailbox Size of All Accounts in Zimbra

Open you VIM to write down below script and execute it. 

#!/bin/bash 
all_account=`zmprov gaa`
for account in ${all_account} do mb_size=`zmmailbox -z -m ${account} gms`
echo "Mailbox size of ${account} = ${mb_size}"
done

Zimbra Bulk Delete Email Message Base on String Using CLI

Generate file list of message to be delete.

zmmailbox -z -m admin@mdkl.gov.my s -l 1000 -t message "in:inbox content:root@mdkl" | awk '{ if(NR > 4){print}}' | cut -c7- | awk '{print $1","}' | tr -d '\n' > /tmp/delmessg

Delete message from list file :

/tmp/todel # zmmailbox -z -m admin@mdkl.gov.my dm `cat /tmp/todel`

Reset Root Or Admin Password For FreeBSD

BSD operating system is secured by default. It have a very good reputation of being the most secured Unix based OS compared to its sibling Linux OS.

As server administartor I have several experience whereby i can’t remember my login password. Sometime it might happen when we typed a different character unconciously while setting it first time, really??

This workaround only can be done if you have an access to physical server. If were accessing using remote tool, you need to ask the server admin guy to do it for you by providing temporary password.

Restart the operating system.

Hit ESC when the OS boots up.

On boot option view, choose to boot into Single User Mode (option 4)

Select the default shell (/bin/sh).

When the machine is booted up and you see the prompt, enter following command ; mount -u / * mount -a

Type passwd command to reset the password.

Enter the new password and confirm it.

Type reboot to reboot the machine (or press the shutdown button to reboot)

Single user mode normally being used for adminstrative task purposes and it’s the first runlevel after boot. Only root user can access this level.

All basic OS command tool is available in this stage except the program that relied on others services or networking connectivity as it’s only available on the above runlevel (2-5).

This workaround might be same for others Linux based OS with a minor change of parameters or command.