May 27, 2010

“no such account…” during zimbra restores

Filed under: Messaging, Zimbra — morgan @ 10:59

I’m working on a migration where we’re moving users one by one from a production environment to a dev environment. To oversimplify, the process is:
- backup in production,
- zmbackupquery -lb

So:
zmbackup -f -z -a user@domain.com
then


$ zmrestore -c -lb full-20100527.153703.317 -a user@domain.com
Error occurred during restore. Check logs for more details.
The following accounts have not been restored:
  user@domain.com

A look at mailbox.log reveals:


com.zimbra.cs.account.AccountServiceException: no such account: ef423485-424b-4fec-a064-f797ffc4ae29
ExceptionId:btpool0-116://localhost:7071/service/admin/soap/RestoreRequest:1274974984703:209afa27e2965ffa
Code:account.NO_SUCH_ACCOUNT
	at com.zimbra.cs.account.AccountServiceException.NO_SUCH_ACCOUNT(AccountServiceException.java:177)
	at com.zimbra.cs.mailbox.Mailbox.getAccount(Mailbox.java:515)
...

“ef423485-424b-4fec-a064-f797ffc4ae29″ is presumably a zimbraid. I can’t for the life of me figure out where it originates–I can’t find it anywhere in either environment.

The workaround is surprisingly straightforward. Instead of the zmrestore above, restore to a restored_ account and rename the account:


$ zmrestore -c -ca -pre restored_ -lb full-20100527.153703.317 -a user@domain.com
$ zmprov ra restored_user@domain.com user@domain.com

May 14, 2010

Turn on recipient verify in Zimbra

Filed under: Messaging, Zimbra — morgan @ 16:05

I’d love to know why Zimbra does not ship with recipient verify turned on. Here’s the use case: a user sends a message from the web interface with an invalid recipient. He/she does not get an error when the message is sent but instead receives an immediate bounce. Sure the info is in the bounce but it’s easy to miss in a cluttered inbox and it’s a hassle to parse.

The solution is very simple. On each host running postfix:

As zimbra:

$ vi /opt/zimbra/postfix/conf/main.cf
relay_recipient_maps = ldap:/opt/zimbra/conf/ldap-vam.cf

$ vi /opt/zimbra/conf/zmmta.cf
POSTCONF smtpd_reject_unlisted_recipient yes

$ zmmtactl restart

This works in zcs 5.0.x and 6.0.6. It will likely work in other versions as well.

Powered by WordPress