| 1 | package Sisimai::Reason::ContentError; | ||||||||||||||||||||
| 2 | 49 | ▶ | use v5.26; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 49 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 49 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 49 | ▶ | use Sisimai::Eb; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 40 | ▶ | sub text { $Sisimai::Eb::ReBODY } | ||||||||||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 8 | 4 | ▶ | sub description { 'Email rejected due to a header format of the email' } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 9 | 1040 | ▶ | sub match { | ||||||||||||||||||
|
Subroutine
match: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 10 | # Try to match that the given text and regular expressions | ||||||||||||||||||||
| 11 | # @param [String] argv1 String to be matched with regular expressions | ||||||||||||||||||||
| 12 | # @return [Integer] 0: Did not match | ||||||||||||||||||||
| 13 | # 1: Matched | ||||||||||||||||||||
| 14 | # @since v4.0.0 | ||||||||||||||||||||
| 15 | 1040 | my $class = shift; | |||||||||||||||||||
| 16 | 1040 | ▶ | my $argv1 = shift // return 0; | ||||||||||||||||||
|
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 1039 | state $index = [ | |||||||||||||||||||
| 19 | "charset not supported", | ||||||||||||||||||||
| 20 | "executable files are not allowed in compressed files", | ||||||||||||||||||||
| 21 | "header error", | ||||||||||||||||||||
| 22 | "header size exceeds maximum permitted", | ||||||||||||||||||||
| 23 | "illegal attachment on your message", | ||||||||||||||||||||
| 24 | "improper use of 8-bit data in message header", | ||||||||||||||||||||
| 25 | "it has a potentially executable attachment", | ||||||||||||||||||||
| 26 | "message contain invalid mime headers", | ||||||||||||||||||||
| 27 | "message contain improperly-formatted binary content", | ||||||||||||||||||||
| 28 | "message contain text that uses unnecessary base64 encoding", | ||||||||||||||||||||
| 29 | "message header size, or recipient list, exceeds policy limit", | ||||||||||||||||||||
| 30 | "message mime complexity exceeds the policy maximum", | ||||||||||||||||||||
| 31 | "message was blocked because its content presents a potential", # https://support.google.com/mail/answer/6590 | ||||||||||||||||||||
| 32 | "routing loop detected -- too many received: headers", | ||||||||||||||||||||
| 33 | 'too many "received" headers', # Exim/deliver.c:5425 | ||||||||||||||||||||
| 34 | "we do not accept messages containing images or other attachments", | ||||||||||||||||||||
| 35 | ]; | ||||||||||||||||||||
| 36 | 1039 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 37 | 1014 | return 0; | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 1040 | ▶ | sub true { | ||||||||||||||||||
|
Subroutine
true: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 41 | # Rejected email due to header format of the email | ||||||||||||||||||||
| 42 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||||||||||
| 43 | # @return [Integer] 1: rejected due to content error | ||||||||||||||||||||
| 44 | # 0: is not content error | ||||||||||||||||||||
| 45 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||||||||||
| 46 | 1040 | my $class = shift; | |||||||||||||||||||
| 47 | 1040 | ▶ | my $argvs = shift // return 0; | ||||||||||||||||||
|
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1039 | require Sisimai::Reason::SpamDetected; | |||||||||||||||||||
| 50 | 1039 | ▶ | return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReBODY; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 51 | 1039 | ▶ | return 0 if Sisimai::Reason::SpamDetected->true($argvs); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 52 | 992 | ▶ | return 1 if (Sisimai::SMTP::Status->name($argvs->{'deliverystatus'}) || '') eq $Sisimai::Eb::ReBODY; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
MC/DC100%1/1
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'})
Truth table100%2/2
A
A= 'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'})
| |||||||||||||||||||||
| 53 | 977 | return __PACKAGE__->match(lc $argvs->{'diagnosticcode'}); | |||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 49 | 1; | |||||||||||||||||||
| 57 | __END__ | ||||||||||||||||||||