estadísticas de un mailbox

29 de mayo de 2009

De la cantidad de script que hay dentro de /opt/zimbra/bin uno muy útil es el zmmailbox. Su utilización es muy parecida al zmprov. Este comando se utiliza para manejar los buzones. Lo podemos lanzar (al igual que zmprov) por línea de comandos o simplemente utilizar su consola.

[zimbra@zimbra ~]$ zmmailbox --help
zmmailbox [args] [cmd] [cmd-args ...]

  -h/--help                                display usage
  -f/--file                                use file as input stream
  -u/--url      http[s]://{host}[:{port}]  server hostname and optional port. must
                                           use admin port with -z/-a
  -a/--admin    {name}                     admin account name to auth as
  -z/--zadmin                              use zimbra admin name/password from
                                           localconfig for admin/password
  -y/--authtoken {authtoken}               use auth token string(has to be in JSON
                                           format) from command line
  -Y/--authtokenfile {authtoken file}      use auth token string(has to be in JSON
                                           format) from command line
  -m/--mailbox  {name}                     mailbox to open
  -p/--password {pass}                     password for admin account and/or mailbox
  -P/--passfile {file}                     read password from file
  -r/--protocol {proto|req-proto/response-proto} specify request/response protocol
                                                 [soap11,soap12,json]
  -v/--verbose                             verbose mode (dumps full exception stack 
                                           trace)
  -d/--debug                               debug mode (dumps SOAP messages)

 zmmailbox is used for mailbox management. Try:

     zmmailbox help admin           help on admin-related commands
     zmmailbox help account         help on account-related commands
     zmmailbox help appointment     help on appoint-related commands
     zmmailbox help commands        help on all commands
     zmmailbox help contact         help on contact-related commands
     zmmailbox help conversation    help on conversation-related commands
     zmmailbox help filter          help on filter-realted commnds
     zmmailbox help folder          help on folder-related commands
     zmmailbox help item            help on item-related commands
     zmmailbox help message         help on message-related commands
     zmmailbox help misc            help on misc commands
     zmmailbox help permission      help on permission commands
     zmmailbox help search          help on search-related commands
     zmmailbox help tag             help on tag-related commands

Este es un ejemplo de como obtener una estadística (tamaño, carpetas, correos leídos) de un buzón. En mi caso voy a sacar las estadísticas del buzón admin@dominio.com:
[zimbra@zimbra ~]$ zmmailbox
mbox> adminAuthenticate admin@dominio.com mipsw1234

mbox> selectMailbox admin@dominio.com
mailbox: admin@dominio.com, size: 7.01 MB, messages: 531, unread: 330

mbox admin@dominio.com> GetAllFolders
        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
         1  conv           0           0  /
        16  docu           0           0  /Briefcase
        10  appo           0           1  /Calendar
        14  mess           0           0  /Chats
         7  cont           0           0  /Contacts
         6  mess           0           0  /Drafts
        13  cont           0           1  /Emailed Contacts
         2  mess           0           6  /Inbox
      4818  mess           3           9  /Inbox/jupiter
      8509  mess           2          15  /Inbox/asterisk
      4817  mess           0           0  /Inbox
      5279  mess          91         111  /Inbox/antivirus
      6025  mess           0           1  /Inbox/backup
      5283  mess           1           1  /Inbox/mail report
      5280  mess           7          24  /Inbox/virus
      5281  mess           9          48  /Inbox/xtras
         4  mess          26          26  /Junk
        12  wiki           0           0  /Notebook
         5  mess           0           3  /Sent
        15  task           0           0  /Tasks
         3  conv         191         285  /Trash

También es posible sacar las estadísticas sin necesidad de entrar en la consola del comando:
zmmailbox -z -m user@domain.com gms -> Tamaño de un buzón
zmmailbox -z -m user@domain.com gaf -> Estadisticas de un buzón

Más información:
+ zmmailbox