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

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
emnzava
Posts: 44
Joined: Sat Sep 13, 2014 1:28 am

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

Postby emnzava » Tue Jan 20, 2015 3:55 am

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?

Postby faulumpy » Tue Jan 20, 2015 4:55 am

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.
emnzava
Posts: 44
Joined: Sat Sep 13, 2014 1:28 am

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

Postby emnzava » Tue Jan 20, 2015 7:46 am

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?

Postby faulumpy » Tue Jan 20, 2015 9:03 am


#!/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?

Postby soul_slayer88 » Thu Jan 11, 2018 3:27 am

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: 25702
Joined: Fri Sep 12, 2014 9:56 pm

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

Postby phoenix » Thu Jan 11, 2018 6:09 am

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

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
djulien
Posts: 3
Joined: Wed Jan 10, 2018 4:25 pm

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

Postby djulien » Thu Jan 11, 2018 8:50 am

What about redicrection using filters ? does it show it ?
User avatar
ccelis5215
Outstanding Member
Outstanding Member
Posts: 577
Joined: Sat Sep 13, 2014 2:04 am
Location: Caracas - Venezuela
ZCS/ZD Version: 8.0.9.GA.6191.UBUNTU12.64 FOSS

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

Postby ccelis5215 » Thu Jan 11, 2018 10:47 am

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


Hi,

Use zimbraMailSieve and parse 'redirect'.

ccelis

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 19 guests