---
title: 'mailserver:checks'
url: 'https://docs.danami.com/warden/command-line-interface/mailserver/mailserver-checks'
markdown: 'https://docs.danami.com/warden/command-line-interface/mailserver/mailserver-checks.md'
date: '2026-10-07'
description: 'Configure the mail server checks. warden --task=mailserver:checks --oper=<header_add|header_del|body_add|body_del> Option Value Description --oper <string> The operation you want to perform. Operations: header_add, header_del, body_add, body_del --pattern <string> The pattern t…'
taxonomy:
  category:
    - docs
  tag:
    - mailserver
---

[](#)  [ Basics ](https://docs.danami.com/warden/)     [ Command Line Interface ](https://docs.danami.com/warden/command-line-interface)      Mailserver       mailserver:checks    

# mailserver:checks

Configure the mail server checks.

```
warden --task=mailserver:checks --oper=<header_add|header_del|body_add|body_del>
```

| Option | Value | Description |
|---|---|---|
| `--oper` | <string> | The operation you want to perform. Operations: header\_add, header\_del, body\_add, body\_del |
| `--pattern` | <string> | The pattern to match. |
| `--action` | <string> | The action. Actions: REJECT, OK, DUNNO, DISCARD, HOLD, REDIRECT, BCC, PREPEND, INFO, WARN |
| `--text` | <string> | You can optionally specify a short string of text to be used in the reply and with logging for this message; otherwise, Postfix uses the general reply code and text configured for the restriction. |
| `--reload` | <yes> | Reload the service after saving settings. |

## Examples

```
// reject mail with a specific subject
warden --task=mailserver:checks --oper=header_add --pattern='/^Subject: make money fast/i' --action=REJECT --text='Your subject is banned' --reload=yes

// remove header rule from above
warden --task=mailserver:checks --oper=header_del --pattern='/^Subject: make money fast/i' --reload=yes

// reject mail with a specific keyword in the body
warden --task=mailserver:checks --oper=body_add --pattern='/viagra/i' --action=REJECT --text='Your mail contains a banned keyword' --reload=yes

// remove body rule from above
warden --task=mailserver:checks --oper=body_del --pattern='/viagra/i' --reload=yes

// reject mail containing the known phishing phrase used in the current campaign
warden --task=mailserver:checks --oper=body_add --pattern='/urgent wire transfer/i' --action=REJECT --text='This mail was blocked by policy' --reload=yes
```

## Related Pages

- [Mail Server Access](https://docs.danami.com/warden/settings/mailserver/mailserver-access "Mail Server Access")
- [Mail Server Checks](https://docs.danami.com/warden/settings/mailserver/mailserver-checks "Mail Server Checks")
- [Mail Server Settings](https://docs.danami.com/warden/settings/mailserver/mailserver-settings "Mail Server Settings")

 [ ](https://docs.danami.com/warden/command-line-interface/mailserver/mailserver-access) [](https://docs.danami.com/warden/command-line-interface/mailserver/mailserver-mailserver)

---

## Navigation

- Previous: [mailserver:access](https://docs.danami.com/warden/command-line-interface/mailserver/mailserver-access.md)
- Next: [mailserver:mailserver](https://docs.danami.com/warden/command-line-interface/mailserver/mailserver-mailserver.md)
