How to add a new domain to a Zimbra install and then a new account to the domain

Ok, so you’ve got your zimbra server pretty much up and running and seeing as you’re just like me and had to take a production email server offline and retrofit it like this you have a dozen or two busy email accounts that have been rejecting emails for the past 12 hours and that needs to be fixed 🙂

So before you address the other issues you want to get those email addresses back online but before you can do that you have to be able to add their domains to the Zimbra server and this is where the literature because bloody elusive. Everyone on the forums is talking about adding a domain in a different sense but all you want to do is add a domain so it can start receiving emails, not so people can access their webmail from mail.domain2.com

So how do we go about doing this with the CLI and not the web interface as that’s broken right now?

su zimbra

cd /opt/zimbra/bin

./zmprov

cd domain2.com

Now there are a bunch of options you can do here for attributes and what not but for now I’m keeping it pretty simple

After this(still in zmprov) you’re going to want to add an account to this domain and then set it’s password. I can’t remember why it’s important but I’ve read it is better to create the account with a blank password(hence the ”) and then set it manually afterwards

ca email@domain2.com

setPassword email@domain2.com password

That should do it though, you should be able to receive emails just fine and dandy now, assuming that your MX records are setup properly.

Here’s a great page with a bunch of examples: http://wiki.zimbra.com/wiki/Zmprov_Examples

All of zmprov commands here: http://www.zimbra.com/docs/ne/6.0.8/administration_guide/A_app-command-line.20.04.html#1293179