Difference between revisions of "King0770-Notes-Removal of Bad Contact Address"

Line 1: Line 1:
{{BC|Community Sandbox}}
<div class="col-md-12 ibox-content">
=King Notes Removal of bad Contacts Addess=
{{KB|{{Unsupported}}|{{ZCS 7.0}}||}}
{{ WIP }}
{{ WIP }}
Line 29: Line 34:
[[Category:Community Sandbox]]
{{Article Footer|Zimbra Collaboration  7.0|04/16/2014}}

Latest revision as of 10:04, 12 July 2015

King Notes Removal of bad Contacts Addess

   KB 3116        Last updated on 2015-07-12  

(0 votes)

Here's a small script to remove a bad contact address for all users. Sometimes users will accidentally send a message to a bad address, contaminating their contact folder, "Emailed Contacts". Through circumstance, bad contact addresses can be populated in a user's contact folders, this can be a nuisance for the autocomplete feature if the user is not paying a attention to the address.


if [ -z "$1" ]; then
echo "usage:  rm_badcontact.sh somebadaddress@somedomain.com"
exit 0

if [ `whoami` != "zimbra" ]; then
        echo "You must be the zimbra user to run this script."
                exit 0

for i in `zmprov -l gaa`
BADADDR=`zmmailbox -z -m "$i" s -t contact "$1" | awk '{ if (NR!=1) {print}}' | grep -v -e Id -e "-" | awk '{ print $2 }' | grep -v "^$"`
        if [ "$RETVAL" = 0 ]; then
          echo "Removing "$1" from "$i"" >> /tmp/remove_badaddress.$$
          zmmailbox -z -m "$i" dct "$BADADDR"

Verified Against: Zimbra Collaboration 7.0 Date Created: 04/16/2014
Article ID: https://wiki.zimbra.com/index.php?title=King0770-Notes-Removal_of_Bad_Contact_Address Date Modified: 2015-07-12

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 »

Jump to: navigation, search