| 1 | package Sisimai::Reason::SpamDetected; | ||||||||||||||||||||
| 2 | 51 | ▶ | use v5.26; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 51 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 51 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 51 | ▶ | use Sisimai::Eb; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 51 | ▶ | use Sisimai::String; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 51 | ▶ | use Sisimai::SMTP::Command; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 52 | ▶ | sub text { $Sisimai::Eb::ReSPAM } | ||||||||||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 10 | 4 | ▶ | sub description { 'Email rejected by spam filter running on the remote host' } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 11 | 1426 | ▶ | sub match { | ||||||||||||||||||
|
Subroutine
match: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||
| 12 | # Try to match that the given text and regular expressions | ||||||||||||||||||||
| 13 | # @param [String] argv1 String to be matched with regular expressions | ||||||||||||||||||||
| 14 | # @return [Integer] 0: Did not match | ||||||||||||||||||||
| 15 | # 1: Matched | ||||||||||||||||||||
| 16 | # @since v4.1.19 | ||||||||||||||||||||
| 17 | 1426 | my $class = shift; | |||||||||||||||||||
| 18 | 1426 | ▶ | 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()
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 1425 | state $index = [ | |||||||||||||||||||
| 21 | "blacklisted url in message", | ||||||||||||||||||||
| 22 | "block for spam", | ||||||||||||||||||||
| 23 | "blocked by policy: no spam please", | ||||||||||||||||||||
| 24 | "blocked by spamassassin", # rejected by SpamAssassin | ||||||||||||||||||||
| 25 | "classified as spam and is rejected", | ||||||||||||||||||||
| 26 | "content filter rejection", | ||||||||||||||||||||
| 27 | "denied due to spam list", | ||||||||||||||||||||
| 28 | "identified spam", # 554 SpamBouncer identified SPAM, message permanently rejected (#5.3.0) | ||||||||||||||||||||
| 29 | "may consider spam", | ||||||||||||||||||||
| 30 | "message content rejected", | ||||||||||||||||||||
| 31 | "message has been temporarily blocked by our filter", | ||||||||||||||||||||
| 32 | "message is being rejected as it seems to be a spam", | ||||||||||||||||||||
| 33 | "message was rejected by recurrent pattern detection system", | ||||||||||||||||||||
| 34 | "our email server thinks this email is spam", | ||||||||||||||||||||
| 35 | "reject bulk.advertising", | ||||||||||||||||||||
| 36 | "spam check", | ||||||||||||||||||||
| 37 | "spam content ", | ||||||||||||||||||||
| 38 | "spam detected", | ||||||||||||||||||||
| 39 | "spam email", | ||||||||||||||||||||
| 40 | "spam-like header", | ||||||||||||||||||||
| 41 | "spam message", | ||||||||||||||||||||
| 42 | "spam not accepted", | ||||||||||||||||||||
| 43 | "spam refused", | ||||||||||||||||||||
| 44 | "spamming not allowed", | ||||||||||||||||||||
| 45 | "unsolicited ", | ||||||||||||||||||||
| 46 | "your email breaches local uribl policy", | ||||||||||||||||||||
| 47 | ]; | ||||||||||||||||||||
| 48 | 1425 | state $pairs = [ | |||||||||||||||||||
| 49 | ["accept", " spam"], | ||||||||||||||||||||
| 50 | ["appears", " to ", "spam"], | ||||||||||||||||||||
| 51 | ["bulk", "mail"], | ||||||||||||||||||||
| 52 | ["considered", " spam"], | ||||||||||||||||||||
| 53 | ["contain", " spam"], | ||||||||||||||||||||
| 54 | ["detected", " spam"], | ||||||||||||||||||||
| 55 | ["greylisted", " please try again in"], | ||||||||||||||||||||
| 56 | ["mail score (", " over "], | ||||||||||||||||||||
| 57 | ["mail rejete. mail rejected. ", "506"], | ||||||||||||||||||||
| 58 | ["message ", "as spam"], | ||||||||||||||||||||
| 59 | ["message ", "like spam"], | ||||||||||||||||||||
| 60 | ["message ", "spamprofiler"], | ||||||||||||||||||||
| 61 | ["probab", " spam"], | ||||||||||||||||||||
| 62 | ["refused by", " spamprofiler"], | ||||||||||||||||||||
| 63 | ["reject", " content"], | ||||||||||||||||||||
| 64 | ["reject, id=", "spam"], | ||||||||||||||||||||
| 65 | ["rejected by ", " (spam)"], | ||||||||||||||||||||
| 66 | ["rejected due to spam ", "classification"], | ||||||||||||||||||||
| 67 | ["rule imposed as ", " is blacklisted on"], | ||||||||||||||||||||
| 68 | ["score", "spam"], | ||||||||||||||||||||
| 69 | ["spam ", "block"], | ||||||||||||||||||||
| 70 | ["spam ", "filter"], | ||||||||||||||||||||
| 71 | ["spam ", " exceeded"], | ||||||||||||||||||||
| 72 | ["spam ", "score"], | ||||||||||||||||||||
| 73 | ]; | ||||||||||||||||||||
| 74 | 1425 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 75 | 1357 | ▶ | return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 76 | 1314 | return 0; | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 1828 | ▶ | sub true { | ||||||||||||||||||
|
Subroutine
true: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||
| 80 | # Rejected due to spam content in the message | ||||||||||||||||||||
| 81 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||||||||||
| 82 | # @return [Integer] 1: rejected due to spam | ||||||||||||||||||||
| 83 | # 0: is not rejected due to spam | ||||||||||||||||||||
| 84 | # @since v4.1.19 | ||||||||||||||||||||
| 85 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||||||||||
| 86 | 1828 | my $class = shift; | |||||||||||||||||||
| 87 | 1828 | ▶ | my $argvs = shift // return 0; return 0 unless $argvs->{'deliverystatus'}; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 1194 | ▶ | return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReSPAM; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 90 | 1193 | ▶ | return 1 if (Sisimai::SMTP::Status->name($argvs->{'deliverystatus'}) || '') eq $Sisimai::Eb::ReSPAM; | ||||||||||||||||||
|
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'})
| |||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | # The value of "reason" isn't "SpamDetected" when the value of "command" is an SMTP command to | ||||||||||||||||||||
| 93 | # be sent before the SMTP DATA command because all the MTAs read the headers and the entire | ||||||||||||||||||||
| 94 | # message body after the DATA command. | ||||||||||||||||||||
| 95 | 1193 | ▶ | return 0 if grep { $argvs->{'command'} eq $_ } Sisimai::SMTP::Command->ExceptDATA->@*; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 96 | 799 | return __PACKAGE__->match(lc $argvs->{'diagnosticcode'}); | |||||||||||||||||||
| 97 | } | ||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 51 | 1; | |||||||||||||||||||
| 100 | __END__ | ||||||||||||||||||||