add callback functionality to before and after mail delivery