| 1 | package Sisimai::Rhost::KDDIscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/KDDI/; |
| 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/KDDI/find(). { |
| 7 | # Detect bounce reason from au(KDDI) |
| 8 | # @param [Sisimai::Fact] argvs Decoded email object |
| 9 | # @return [String] The bounce reason au.com and ezweb.ne.jp |
| 10 | # @since v4.22.6 |
| 11 | my $class = shiftscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/KDDI/shift().; |
| 12 | my $argvs = shiftscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/KDDI/shift(). // return ""; return "" unless $argvs->{'diagnosticcode'}; |
| 13 | |
| 14 | state $messagesof = { |
| 15 | 'filtered' => '550 : user unknown', # The response was: 550 : User unknown |
| 16 | 'userunknown' => '>: user unknown', # The response was: 550 <...>: User unknown |
| 17 | }; |
| 18 | my $issuedcode = lcscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/KDDI/lc(). $argvs->{'diagnosticcode'}; |
| 19 | my $reasontext = ''; |
| 20 | |
| 21 | for my $e ( keysscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/KDDI/keys(). %$messagesof ) { |
| 22 | # Try to match the error message with message patterns defined in $MessagesOf |
| 23 | next unless rindexscip-perl cpan Sisimai v5.7.0 Sisimai/Rhost/KDDI/rindex().($issuedcode, $messagesof->{ $e }) > -1; |
| 24 | $reasontext = $e; |
| 25 | last; |
| 26 | } |
| 27 | return $reasontext; |
| 28 | } |
| 29 | |
| 30 | 1; |
| 31 | __END__ |
| 32 | |
| 33 | =encoding utf-8 |
| 34 | |
| 35 | =head1 NAME |
| 36 | |
| 37 | Sisimai::Rhost::KDDI - Detect the bounce reason returned from au (KDDI). |
| 38 | |
| 39 | =head1 SYNOPSIS |
| 40 | |
| 41 | use Sisimai::Rhost::KDDI; |
| 42 | |
| 43 | =head1 DESCRIPTION |
| 44 | |
| 45 | C<Sisimai::Rhost::KDDI> detects the bounce reason from the content of C<Sisimai::Fact> object as an |
| 46 | argument of C<find()> method when the value of C<rhost> of the object is C<msmx.au.com> or C<lsean.ezweb.ne.jp>. |
| 47 | This class is called only C<Sisimai::Fact> class. |
| 48 | |
| 49 | =head1 CLASS METHODS |
| 50 | |
| 51 | =head2 C<B<find(I<Sisimai::Fact Object>)>> |
| 52 | |
| 53 | C<find()> method detects the bounce reason. |
| 54 | |
| 55 | =head1 AUTHOR |
| 56 | |
| 57 | azumakuniyuki |
| 58 | |
| 59 | =head1 COPYRIGHT |
| 60 | |
| 61 | Copyright (C) 2018,2020,2021,2023-2025 azumakuniyuki, All rights reserved. |
| 62 | |
| 63 | =head1 LICENSE |
| 64 | |
| 65 | This software is distributed under The BSD 2-Clause License. |
| 66 | |
| 67 | =cut |
| 68 |