Thursday, December 3, 2009

Zimbra public folders

When migrating from that other closed source groupware product to Zimbra, you will probably have to setup the system with a Public Folders view, resembling the other product. While it is possible to do in Zimbra, it's a bit cumbersome. The way I did it, is to create a 'user' per public folder, then share it's Inbox with the users that need access (using a mailinglist as share destination is also possible).

The procedure is can be done from the command line:

First create a Folder per user to store the public folders in:

$ zmmailbox -z -m user@domain.be cf --view message /PublicFolders


Then for every public folder account, share it's inbox with that user:

$ zmmailbox -z -m pubfolder@domain.be mfg /Inbox account user@domain.be rwidx


Then mount the share for the user:

$ zmmailbox -z -m user@domain.be cm --view message /PublicFolders/Pubfolder pubfolder@domain.be /Inbox



You can ofcourse script it, with something like this... (will output a script you feed to 'zmmailbox -z')

-------------[ python code ]--------
allusers = ['user1@domain.be', 'user2@domain.be', 'user3@domain.be']
pubfolders = ['folder1@domain.be', 'folder2@domain.be']

def createPublicFolderMap(users):
'''
create a folder to act as a parent for all the public folder submaps
'''

for user in users:
print "selectMailbox " + user
print "createFolder --view message /PublicFolders"

def createAndSharePubFolder(folder, users):
'''
creates the share on the public folder's inbox to the users
and creates a share mountpoint in the users for that inbox
'''
folderName = folder[:folder.find('@')]
folderName = folderName[0].upper()+folderName[1:]

print "selectMailbox " + folder
for user in users:
print "modifyFolderGrant /Inbox account "+user+" rwidx"

for user in users:
print "selectMailbox " + user
print "createMountPoint --view message /PublicFolders/" \
+folderName+" "+folder+" /Inbox"


createPublicFolderMap(allusers)
for pubfolder in pubfolders:
createAndSharePubFolder(pubfolder, allusers)
-------------[ python code ]--------

Wednesday, December 2, 2009

Zimbra ZCS6.0.2 server statistics failing

Ran into a problem where the Server Statistics in the Monitoring tab of the admin view were giving an error. The view uses the information written to /var/log/zimbra-stats.log however that file wasn't rotating correctly at night causing the statistics view to fail.

There were 2 issues at work here. For one, the logrotate scripts were using the killall command, which wasn't present on the system (a Debian 5.0.3 with just the Standard tasksel). Reported as Bug 43079. The other issue was that the killall parameters used syslogd, whereas debian lenny uses rsyslogd, which killall won't rightfully touch, reported as Bug 43081.