Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate shell commands for migrating mail boxes from IMAP provider to Zimbra
import os
import sys
host1 = ''
host2 = ''
cos = 'cos-of-group-for-the-account'
data = """ password password3 password2"""
accounts = []
for a in data.split('\n'):
u,p = a.split(' ')
"user": u,
"password": p
print "#!/bin/bash"
print "set -e"
for acc in accounts:
print "# account %s" % (acc['user'])
print "zmprov ca %s %s zimbraCOSid %s" % (acc['user'], acc['password'], cos)
print "imapsync --buffersize 8192000 --nosyncacls --subscribe --syncinternaldates --host1 %s --user1 %s --password1 %s --ssl1 --port1 993 --host2 %s --user2 %s --password2 %s -ssl2 --port2 993 --noauthmd5" % (host1, acc['user'], acc['password'], host2, acc['user'], acc['password'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment