File Coverage

lib/Sisimai/Reason/MailboxFull.pm
Criterion Covered Total %
statement 24 24 100.0
branch 9 10 90.0
condition 5 6 83.3
subroutine 7 7 100.0
pod 2 4 50.0
total 47 51 92.1


line stmt bran cond sub pod time code
1             package Sisimai::Reason::MailboxFull;
2 59     59   1049 use feature ':5.10';
  59         138  
  59         4747  
3 59     59   349 use strict;
  59         89  
  59         2088  
4 59     59   330 use warnings;
  59         80  
  59         17730  
5              
6 168     168 1 383 sub text { 'mailboxfull' }
7 4     4 0 12 sub description { "Email rejected due to a recipient's mailbox is full" }
8             sub match {
9             # Try to match that the given text and regular expressions
10             # @param [String] argv1 String to be matched with regular expressions
11             # @return [Integer] 0: Did not match
12             # 1: Matched
13             # @since v4.0.0
14 2417     2417 1 8054 my $class = shift;
15 2417   50     5640 my $argv1 = shift // return undef;
16              
17 2417         3193 state $index = [
18             'account disabled temporarly for exceeding receiving limits',
19             'account is exceeding their quota',
20             'account is over quota',
21             'account is temporarily over quota',
22             'boite du destinataire pleine',
23             'delivery failed: over quota',
24             'disc quota exceeded',
25             'does not have enough space',
26             'exceeded storage allocation',
27             'exceeding its mailbox quota',
28             'full mailbox',
29             'is over disk quota',
30             'is over quota temporarily',
31             'mail file size exceeds the maximum size allowed for mail delivery',
32             'mail quota exceeded',
33             'mailbox exceeded the local limit',
34             'mailbox full',
35             'mailbox has exceeded its disk space limit',
36             'mailbox is full',
37             'mailbox over quota',
38             'mailbox quota usage exceeded',
39             'mailbox size limit exceeded',
40             'maildir over quota',
41             'maildir delivery failed: userdisk quota ',
42             'maildir delivery failed: domaindisk quota ',
43             'mailfolder is full',
44             'not enough storage space in',
45             'over the allowed quota',
46             'quota exceeded',
47             'quota violation for',
48             'recipient reached disk quota',
49             'recipient rejected: mailbox would exceed maximum allowed storage',
50             'the recipient mailbox has exceeded its disk space limit',
51             "the user's space has been used up",
52             'the user you are trying to reach is over quota',
53             'too much mail data', # @docomo.ne.jp
54             'user has exceeded quota, bouncing mail',
55             'user has too many messages on the server',
56             'user is over quota',
57             'user is over the quota',
58             'user over quota',
59             'user over quota. (#5.1.1)', # qmail-toaster
60             'was automatically rejected: quota exceeded',
61             'would be over the allowed quota',
62             ];
63 2417 100       4306 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  106348         135673  
64 2357         4962 return 0;
65             }
66              
67             sub true {
68             # The envelope recipient's mailbox is full or not
69             # @param [Sisimai::Data] argvs Object to be detected the reason
70             # @return [Integer] 1: is mailbox full
71             # 0: is not mailbox full
72             # @since v4.0.0
73             # @see http://www.ietf.org/rfc/rfc2822.txt
74 2018     2018 0 2963 my $class = shift;
75 2018   100     4399 my $argvs = shift // return undef;
76              
77 2017 100       3846 return undef unless $argvs->deliverystatus;
78 1617 50       8362 return 1 if $argvs->reason eq 'mailboxfull';
79              
80             # Delivery status code points "mailboxfull".
81             # Status: 4.2.2
82             # Diagnostic-Code: SMTP; 450 4.2.2 <***@example.jp>... Mailbox Full
83 1617 100 100     7363 return 1 if (Sisimai::SMTP::Status->name($argvs->deliverystatus) || '') eq 'mailboxfull';
84              
85             # Check the value of Diagnosic-Code: header with patterns
86 1478 100       3844 return 1 if __PACKAGE__->match(lc $argvs->diagnosticcode);
87 1468         4856 return 0;
88             }
89              
90             1;
91             __END__