writing test file when attachment is delivered