summaryrefslogtreecommitdiff
path: root/upgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-23 13:50:15 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-23 13:50:15 (GMT)
commit811f83ace1e63d493093dff78151e9a64d90cf53 (patch)
treef3dde9326fdc7b4d3592f46c95bf687915ed4513 /upgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh
parentbe3183ea867ad6fe909e9684b45d6e3667cf2ede (diff)
downloadkolab-scripts-811f83ace1e63d493093dff78151e9a64d90cf53.tar.gz
Add the kolab-scripts used in migration and development
Diffstat (limited to 'upgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh')
-rwxr-xr-xupgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh69
1 files changed, 69 insertions, 0 deletions
diff --git a/upgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh b/upgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh
new file mode 100755
index 0000000..245343d
--- /dev/null
+++ b/upgrade-to-3.0-native-from-2.3-openpkg/32-count-groupware-messages-with-base64-encoding.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Interesting Annotations
+declare -a ia
+
+ia[${#ia[@]}]="/shared/vendor/kolab/folder-type"
+
+pushd /root/pykolab.git >/dev/null 2>&1
+
+for folder_search in user/*@kolabsys.com shared/*@kolabsys.com; do
+ ./kolab.py list-mailbox-metadata "${folder_search}" | while read line; do
+ if [ ! -z "$(echo $line | grep ^Folder)" ]; then
+ current_folder=$(echo $line | cut -d' ' -f2-)
+ else
+ annotation_key=$(echo $line | awk '{print $1}')
+ annotation_value=$(echo $line | awk '{print $2}')
+
+ # See if it is indeed interesting metadata
+ i=0
+ interesting_annotation=0
+ while [ $i -lt ${#ia[@]} ]; do
+ if [ "${ia[$i]}" == "${annotation_key}" ]; then
+ case "${annotation_value}" in
+ contact|contact.default)
+ interesting_annotation=1
+ ;;
+
+ event|event.default)
+ interesting_annotation=1
+ ;;
+
+ journal|journal.default)
+ interesting_annotation=1
+ ;;
+
+ note|note.default)
+ interesting_annotation=1
+ ;;
+
+ task|task.default)
+ interesting_annotation=1
+ ;;
+
+ esac
+ fi
+ let i++
+ done
+
+ if [ ${interesting_annotation} -eq 0 ]; then
+ continue
+ fi
+
+ /usr/lib/cyrus-imapd/mbpath "${current_folder}"
+
+ fi
+
+ done | \
+
+ while read folder2; do
+ find "${folder2}" -mindepth 1 -maxdepth 1 -type f -name "*." | \
+ sort | \
+ while read file; do
+ grep -El "^Content-Transfer-Encoding:\s*base64" "${file}"
+ done
+ done
+done | wc -l
+
+popd >/dev/null 2>&1
+