# This part is a no brainer and your mail software # likely already supports something like it: eval { send_mail('postmaster@mei.net', "$dir_entry\@mei.net", "Usage Notice (full mailbox)", $msg) }; if( $@ ) { warn "sleeping for 2 seconds then retrying due to send_mail() WARNING: $@"; sleep 2; redo RETRY; } }