+ my @addresses = Email::Address->parse($self->{$item});
+
+ # if either no address was parsed or
+ # there are more than 3 characters per parsed email extra, assume the the user has entered bunk
+ if (!@addresses) {
+ die t8('"#1" seems to be a faulty list of email addresses. No addresses could be extracted.',
+ $self->{$item},
+ );
+ } elsif ((length($self->{$item}) - sum map { length $_->original } @addresses) / @addresses > 3) {
+ die t8('"#1" seems to be a faulty list of email addresses. After extracing addresses (#2) too many characters are left.',
+ $self->{$item}, join ', ', map { $_->original } @addresses,
+ );
+ }