copy_email_task: properly order some operations