Debian Codegraph @

lib/Sisimai/Rhost/IUA.pm

raw symbols SCIP
1 package Sisimai::Rhost::IUAscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/;
2 use v5.26scip-perl cpan Sisimai v5.7.0 `v5.26`/;
3 use strictscip-perl cpan Sisimai v5.7.0 strict/;
4 use warningsscip-perl cpan Sisimai v5.7.0 warnings/;
5
6 sub findscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/find(). {
7 # Detect bounce reason from https://www.i.ua/
8 # @param [Sisimai::Fact] argvs Decoded email object
9 # @return [String] The bounce reason at https://www.i.ua/
10 # @since v4.25.0
11 my $class = shiftscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/shift().;
12 my $argvs = shiftscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/shift(). // return ""; return "" unless $argvs->{'diagnosticcode'};
13
14 state $errorcodes = {
15 # https://mail.i.ua/err/$(CODE)
16 '1' => 'norelaying', # The use of SMTP as mail gate is forbidden.
17 '2' => 'userunknown', # User is not found.
18 '3' => 'suspend', # Mailbox was not used for more than 3 months
19 '4' => 'mailboxfull', # Mailbox is full.
20 '5' => 'ratelimited', # Letter sending limit is exceeded.
21 '6' => 'norelaying', # Use SMTP of your provider to send mail.
22 '7' => 'blocked', # Wrong value if command HELO/EHLO parameter.
23 '8' => 'rejected', # Couldn't check sender address.
24 '9' => 'blocked', # IP-address of the sender is blacklisted.
25 '10' => 'filtered', # Not in the list Mail address management.
26 };
27 my $issuedcode = lcscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/lc(). $argvs->{'diagnosticcode'};
28 my $codenumber = indexscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/index().($issuedcode, '.i.ua/err/') > 0 ? substrscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/substr().($issuedcode, indexscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/index().($issuedcode, '/err/') + 5, 2) : 0;
29 $codenumber = substrscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/substr().($codenumber, 0, 1) if indexscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/IUA/index().($codenumber, '/') == 1;
30 return $errorcodes->{ $codenumber } || '';
31 }
32
33 1;
34 __END__
35
36 =encoding utf-8
37
38 =head1 NAME
39
40 Sisimai::Rhost::IUA - Detect the bounce reason returned from https://www.i.ua/.
41
42 =head1 SYNOPSIS
43
44 use Sisimai::Rhost::IUA;
45
46 =head1 DESCRIPTION
47
48 C<Sisimai::Rhost::IUA> detects the bounce reason from the content of C<Sisimai::Fact> object as an
49 argument of C<find()> method when the value of C<rhost> of the object is C<*.email.ua>.
50 This class is called only C<Sisimai::Fact> class.
51
52 =head1 CLASS METHODS
53
54 =head2 C<B<find(I<Sisimai::Fact Object>)>>
55
56 C<find()> method detects the bounce reason.
57
58 =head1 AUTHOR
59
60 azumakuniyuki
61
62 =head1 COPYRIGHT
63
64 Copyright (C) 2019-2021,2023-2025 azumakuniyuki, All rights reserved.
65
66 =head1 LICENSE
67
68 This software is distributed under The BSD 2-Clause License.
69
70 =cut
71