JavaIO flushing error and regression test email attachments