fix maildir-related bugs

- bad indentation
- infinite recursion while traversing folders
- typo in exception handler