Don't append attachments multiple times

* Original commit from orenh, updated for WhiteCore