NAME

Sietima::Role::StripHeaders - removes headers from incoming messages

VERSION

version 1.1.5

SYNOPSIS

my $sietima = Sietima->with_traits('StripHeaders')->new({
 %args,
 strip_headers => [ qr{^dkim\b}i, qr{^arc\b}i ],
});

DESCRIPTION

A Sietima list with role applied will remove all headers that match any of the provided regular expressions. This is useful to remove DKIM/ARC cryptographic signatures from incoming messages, which would be broken by the changes that the list makes to the message.

Notice that you can break messages with this: if the regular expressions match necessary headers (like to), those headers will be removed! Be careful, and run some tests.

ATTRIBUTES

strip_headers

Optional arrayref of regular expressions, defaults to the empty array. Any header that matches any of these regular expressions will be removed.

MODIFIED METHODS

munge_mail

This method removes matching headers from each message returned by the original method.

AUTHOR

Gianni Ceccarelli <dakkar@thenautilus.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2025 by Gianni Ceccarelli <dakkar@thenautilus.net>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.