fix a lot of smaller things
add the actual writing to maildirs