add support for large attachments and a replication callback mechanism