aboutsummaryrefslogtreecommitdiff
path: root/lib/Sietima/Role/AvoidDups.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sietima/Role/AvoidDups.pm')
-rw-r--r--lib/Sietima/Role/AvoidDups.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Sietima/Role/AvoidDups.pm b/lib/Sietima/Role/AvoidDups.pm
index 598d57b..964c413 100644
--- a/lib/Sietima/Role/AvoidDups.pm
+++ b/lib/Sietima/Role/AvoidDups.pm
@@ -4,6 +4,23 @@ use Sietima::Policy;
use Email::Address;
use namespace::clean;
+=head1 NAME
+
+Sietima::Role::AvoidDups - prevent people from receiving the same message multiple times
+
+=head1 SYNOPSIS
+
+ my $sietima = Sietima->with_traits('AvoidDups')->new(\%args);
+
+=head1 DESCRIPTION
+
+A L<< C<Sietima> >> list with this role applied will not send a
+message to a subscriber, if that subscriber is already mentioned in
+the C<To:> or C<Cc:> header fields, because they can be assumed to be
+already receiving the message directly from the sender.
+
+=cut
+
around subscribers_to_send_to => sub ($orig,$self,$mail) {
my @already_receiving = map {
Email::Address->parse($_)