| 1 | package Sietima::Role::Debounce; | ||||||||||
| 2 | 2 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use Sietima::Policy; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '1.1.5'; # VERSION | |||||||||
| 7 | # ABSTRACT: avoid mail loops | ||||||||||
| 8 | |||||||||||
| 9 | |||||||||||
| 10 | 2 | my $been_there = 'X-Been-There'; | |||||||||
| 11 | |||||||||||
| 12 | 5 | ▶ | around munge_mail => sub ($orig,$self,$incoming_mail) { | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||
| 13 | 5 | my $return_path = $self->return_path->address; | |||||||||
| 14 | 5 | ▶ | if (my $there = $incoming_mail->header_str($been_there)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 2 | ▶ | return if $there =~ m{\b\Q$return_path\E\b}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | $incoming_mail->header_str_set( | ||||||||||
| 19 | 3 | $been_there => $return_path, | |||||||||
| 20 | ); | ||||||||||
| 21 | |||||||||||
| 22 | 3 | return $self->$orig($incoming_mail); | |||||||||
| 23 | 2 | }; | |||||||||
| 24 | |||||||||||
| 25 | 2 | 1; | |||||||||
| 26 | |||||||||||
| 27 | __END__ | ||||||||||