Difference between revisions of "Remove All Emailed Contacts"

(Script to remove all "/Emailed Contacts" from all users)
 
m (wiki layout revisions)
Line 1: Line 1:
 +
{{ WIP }}
 
Here is a simple script I used to remove all the "/Emailed Contacts" folders for all the users on the system.
 
Here is a simple script I used to remove all the "/Emailed Contacts" folders for all the users on the system.
 
We in-advertedly left the Automatic adding of contacts enabled in our COS
 
We in-advertedly left the Automatic adding of contacts enabled in our COS
Line 5: Line 6:
 
Here is my quick script on how I did it.
 
Here is my quick script on how I did it.
  
<nowiki>
+
<code><pre>
 
#!/bin/bash
 
#!/bin/bash
  
Line 18: Line 19:
 
zmmailbox -z -m $i emptyFolder "/Emailed Contacts"
 
zmmailbox -z -m $i emptyFolder "/Emailed Contacts"
 
done
 
done
 +
</pre></code>
  
 
+
[[Category:Community Sandbox]]
</nowiki>
 

Revision as of 16:18, 5 August 2010

Here is a simple script I used to remove all the "/Emailed Contacts" folders for all the users on the system. We in-advertedly left the Automatic adding of contacts enabled in our COS (Admin GUI under CoS -> Preferences) And after disabling it, we needed to remove all the emailed contacts, so our GAL would work properly. Here is my quick script on how I did it.

#!/bin/bash

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

for i in `zmprov -l gaa`
do
	echo "Emptying the - /Emailed Contacts - folder for $i"
	zmmailbox -z -m $i emptyFolder "/Emailed Contacts"
done
Jump to: navigation, search