rename the file before send_mail is called