Fix folder generation when email support is disabled.

Bug: 12337
Add test for folder generation with no email support.