Fix conditions for sending mails.