Obtain all the forwards per each account

Obtain all the forwards per each account

   KB 21900        Last updated on 07/12/2015  




0.00
(0 votes)


Purpose

In some cases or scenarios, the users can add a forward address, this feature can be used for audit purposes, but sometimes can also be a problem for some Administrators.

Script-forwards-001.png

This Wiki/KB article is a simple script to check in a easy way all the forwards in a Zimbra Collaboration environment.


Resolution

  • The first step is create the script like root user:
vi checkforward.sh
  • Add the next simple script into the Script file:
#!/bin/sh
# Script para visualizar redirecciones en Zimbra
for account in `zmprov -l gaa`; do
forwardingaddress=`zmprov ga $account |grep 'zimbraPrefMailForwardingAddress' |sed 's/zimbraPrefMailForwardingAddress: //'`
if [ "$forwardingaddress" != "" ]; then
echo "$account is forwarding to $forwardingaddress"
else
forwardingaddress=""
fi
done
  • Save the file, and add it the proper rights for the user Zimbra, and make it executable:
chown zimbra:zimbra checkforward.sh
chmod +x checkforward.sh
  • Like zimbra user, you can run the script, and you will see something like the next:
./checkforward.sh
admin@zimbra.local is forwarding to externalaccount@externaldomain.com
testmove@example1.com is forwarding to externalaccount2@externaldomain2.com

Additional Content

  • No related content.


Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 04/27/2015
Article ID: https://wiki.zimbra.com/index.php?title=Obtain_all_the_forwards_per_each_account Date Modified: 07/12/2015



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Wiki/KB reviewed by SME1 SME2 Copyeditor Last edit by Jorge de la Cruz
Jump to: navigation, search