---
name: "Mail::Milter::Module::HeaderRegex"
section: "3pm"
platform: "linux"
package: "libmail-milter-perl"
version: "0.07-2"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/Mail::Milter::Module::HeaderRegex"
---

# Mail::Milter::Module::HeaderRegex(3pm)

milter to accept/reject messages with certain headers

## NAME

Mail::Milter::Module::HeaderRegex - milter to accept/reject messages with certain headers

## SYNOPSIS

```
    use Mail::Milter::Module::HeaderRegex;
    my $milter = new Mail::Milter::Module::HeaderRegex('^Foo: ');
    my $milter2 = &HeaderRegex('^Foo: Bar'); # convenience
```

## DESCRIPTION

This milter module rejects messages at DATA phase if one of the message's headers matches user-supplied regular expressions.

## METHODS

new(REGEX\[, ...\])

Accepts one or more regular expressions, as strings or qr// precompiled regexes.  They are tested in sequence, and the first match terminates checking.

set\_message(MESSAGE)

Sets the message used when rejecting messages.  This string may contain the substring `%H`, which will be replaced by the matching header name.

This method returns a reference to the object itself, allowing this method call to be chained.

## AUTHOR

Todd Vierling, \<tv@duh.org\> \<tv@pobox.com\>

## SEE ALSO

Mail::Milter::Object

## POD ERRORS

Hey! **The above document had some coding errors, which are explained below:**

- Around line 67:

  You can't have =items (as at line 79) unless the first thing after the =over is an =item
