What is output to stderr for each case? The third possibility should work. Using warn or die is incorrect since they take a string to output to STDERR, not a function reference. You probably do want to put a warn inside mal() so the error is logged. Also, you should use or instead of || and mal() instead of &mal.
Comment on Re: Web page output for sendmail problem