This is definitely better to write:
if ($rcmail->task != 'settings' && $rcmail->task != 'mail')