working version - writes to maildir