Attempt to make a quick fix (by dw2412 from #zarafa)
Cleaning up the code to make it really work (Andreas Brodowski).

Also fixing uninitialized variables
Merge pull request #3 from mcepl/zarafa7-compat

Zarafa7 compat