You may need some trimming on the perl script. From my experience, and while i'm writing this i'm finishing a 600 accounts, 400Gb migration to Zimbra i can say that if you dump a CSV that looks like:,password,John,Doe

and follow the instructions, this will work.

well, if you want to use only the username on the CSV, you might be able to hardcode your domain on the script, so that when it creates the entries it uses the domain info you provided.

FAR FAR away from being good on perl, but i THINK something like this would work for you:


# Lookup the valid COS (Class of Service) ID in the interface or like this
my $cosid = `su - zimbra -c 'zmprov gc Default |grep zimbraId:'`;
$cosid =~ s/zimbraId:\s*|\s*$//g;

while (<>) {

# CHANGE ME: To the actual fields you use in your CSV file
my ($uid, $password, $first, $last) = split(/\,/, $_, 4);

#my ($uid, $domain) = split(/@/, $email, 2);

print qq{ca $uid\ $password\n};
print qq{ma $uid\ zimbraCOSid "$cosid"\n};
print qq{ma $uid\ givenName "$first"\n};
print qq{ma $uid\ sn "$last"\n};
print qq{ma $uid\ cn "$uid"\n};
print qq{ma $uid\ displayName "$first $last"\n};
print qq{ma $uid\ zimbraPasswordMustChange TRUE\n};
print qq{\n};