how to list all Forwarding email address in zimbra using command?

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
User avatar
emnzava
Advanced member
Advanced member
Posts: 53
Joined: Sat Sep 13, 2014 1:28 am
ZCS/ZD Version: 9.0.0.GA_P11 UB 14 Network Edition
Contact:

how to list all Forwarding email address in zimbra using command?

Post by emnzava »

Hi,
Recently, one of our staff complained that she is not receiving emails. I had to look on user preference tab to see if unknowingly she enabled email forwarding.
From the preference tab no email forwarding was enabled. So i had to look via command line with grep option.
I came to find out all mails are being forwarded to yahoo email account without leaving a copy of sent email.
I asked her if she knows the address and she said NO.
Therefore, i had to investigate further. Then i came to find out through zimbra admin interface. On her account, email forwarding was enabled without leaving a copy.

Now the question is how come it's not shown on user preference tab?
I only saw it through admin interface.

Also, how can i list all address that have email forwading address?
I suspect someone else might be having the same problem without knowledge.
Regards
User avatar
faulumpy
Posts: 48
Joined: Fri Sep 12, 2014 10:39 pm
ZCS/ZD Version: Release 8.6.0.GA.1153.UBUNTU14.64 U

how to list all Forwarding email address in zimbra using command?

Post by faulumpy »

Try this:
for account in `zmprov -l gaa`; do zmprov ga $account zimbraPrefMailForwardingAddress; done
Release 8.6.0.GA.1153.UBUNTU14.64 UBUNTU14_64 FOSS edition, Patch 8.6.0_P6.
User avatar
emnzava
Advanced member
Advanced member
Posts: 53
Joined: Sat Sep 13, 2014 1:28 am
ZCS/ZD Version: 9.0.0.GA_P11 UB 14 Network Edition
Contact:

how to list all Forwarding email address in zimbra using command?

Post by emnzava »

Thank for the reply.
But suggested solution did not solve my problem. It lists all mail address available while I only want to see forward address.
e.g;
a@example.com forward to x@yahoo.com

b@example.com
Now i only want to see a@example.com with forward address x@yahoo.com. b@example.com should be skipped.


Regards
User avatar
faulumpy
Posts: 48
Joined: Fri Sep 12, 2014 10:39 pm
ZCS/ZD Version: Release 8.6.0.GA.1153.UBUNTU14.64 U

how to list all Forwarding email address in zimbra using command?

Post by faulumpy »


#!/bin/sh

for account in `zmprov -l gaa`; do
forwardingaddress=`zmprov ga $account |grep 'zimbraPrefMailForwardingAddress' |sed 's/zimbraPrefMailForwardingAddress: //'`
if [ "$forwardingaddress" != "" ]; then
echo "$account is forwarded to $forwardingaddress"
else
forwardingaddress=""
fi
done

Release 8.6.0.GA.1153.UBUNTU14.64 UBUNTU14_64 FOSS edition, Patch 8.6.0_P6.
soul_slayer88
Posts: 1
Joined: Thu Jan 11, 2018 3:06 am

Re: how to list all Forwarding email address in zimbra using command?

Post by soul_slayer88 »

Hi,


I am not familiar with any linux platform.
I tried to create the bash file as above, but when i try to execute the file it giving me error " zmprov: command not found"
I execute the bash file using root user. if i use zimbra user, it said file not found.
Where am i missed out ? Any helps is highly appreciate.
Thank you...
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: how to list all Forwarding email address in zimbra using command?

Post by phoenix »

soul_slayer88 wrote:I execute the bash file using root user. if i use zimbra user, it said file not found.
It works fine for me, create the file as root user (then chmod +x) then switch to the Zimbra user (su - zimbra) and run the script with "sh +x tour_filename", what happens? You could also try the one line script in the second post (as the zimbra user) and see if that actually runs.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
djulien
Posts: 3
Joined: Wed Jan 10, 2018 4:25 pm

Re: how to list all Forwarding email address in zimbra using command?

Post by djulien »

What about redicrection using filters ? does it show it ?
User avatar
ccelis5215
Outstanding Member
Outstanding Member
Posts: 632
Joined: Sat Sep 13, 2014 2:04 am
Location: Caracas - Venezuela
ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12

Re: how to list all Forwarding email address in zimbra using command?

Post by ccelis5215 »

djulien wrote:What about redicrection using filters ? does it show it ?
Hi,

Use zimbraMailSieve and parse 'redirect'.

ccelis
vijendra
Posts: 14
Joined: Tue Mar 13, 2018 10:07 pm

Re: how to list all Forwarding email address in zimbra using command?

Post by vijendra »

Hi,

I am using Zimbra 8.6.0_GA_1153.
How can I find all email address which are forwarded to another server or another email server.

Thanks,
Vijendra
prabin
Posts: 7
Joined: Thu Jun 06, 2019 10:56 am

Re: how to list all Forwarding email address in zimbra using command?

Post by prabin »

Hello,

Please help me to setup a forwarding address from txt file for a list of users that already exists via script.

Thanking you in advace.
Post Reply