add support for large attachments and replication callback mechanism