added some testcases for MimeMessage parsing + some simple refactorings (deleted unused code, ...)
changed tabs to spaces
Correct indentation and extract DB invocations to method
Merged changes from tobiasbaum