How about

```php
if (!in_array($rcmail->task, array('settings', 'mail'));
```

?