Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some European languages into Sisimai::Lhost::Office365 #432

Merged
merged 10 commits into from
Feb 26, 2021
Merged
1 change: 1 addition & 0 deletions lib/Sisimai/Lhost/Domino.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sub inquire {
'userunknown' => [
'not listed in Domino Directory',
'not listed in public Name & Address Book',
'no se encuentra en el Directorio de Domino',
"non répertorié dans l'annuaire Domino",
'Domino ディレクトリには見つかりません',
],
Expand Down
28 changes: 25 additions & 3 deletions lib/Sisimai/Lhost/Office365.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ sub inquire {
# X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
# X-MS-Exchange-Transport-CrossTenantHeadersStamped: ...
$match++ if index($mhead->{'subject'}, 'Undeliverable:') > -1;
$match++ if index($mhead->{'subject'}, 'Onbestelbaar:') > -1;
$match++ if index($mhead->{'subject'}, 'Não_entregue:') > -1;
$match++ if $mhead->{'x-ms-exchange-message-is-ndr'};
$match++ if $mhead->{'x-microsoft-antispam-prvs'};
$match++ if $mhead->{'x-exchange-antispam-report-test'};
Expand All @@ -43,13 +45,33 @@ sub inquire {
state $indicators = __PACKAGE__->INDICATORS;
state $rebackbone = qr|^Content-Type:[ ]message/rfc822|m;
state $markingsof = {
'eoe' => qr/\A(?:Original[ ][Mm]essage[ ][Hh]eaders:?|Message[ ]Hops)/,
'eoe' => qr{\A(?:
Original[ ][Mm]essage[ ][Hh]eaders:?
|Message[ ]Hops
|Cabe.+alhos[ ]originais[ ]da[ ]mensagem:
|Oorspronkelijke[ ]berichtkoppen:
)
}x,
'rfc3464' => qr|\AContent-Type:[ ]message/delivery-status|,
'error' => qr/\A(?:Diagnostic[ ]information[ ]for[ ]administrators:|Error[ ]Details)/,
'lhost' => qr{\A(?:
Generating[ ]server
|Bronserver
|Servidor[ ]de[ ]origem
):[ ](.+)\z
}x,
'error' => qr{\A(?:
Diagnostic[ ]information[ ]for[ ]administrators:
|Error[ ]Details
|Diagnostische[ ]gegevens[ ]voor[ ]beheerders:
|Informa.+es[ ]de[ ]diagn.+stico[ ]para[ ]administradores:
)
}x,
'message' => qr{\A(?:
Delivery[ ]has[ ]failed[ ]to[ ]these[ ]recipients[ ]or[ ]groups:
|Original[ ]Message[ ]Details
|.+[ ]rejected[ ]your[ ]message[ ]to[ ]the[ ]following[ ]e[-]?mail[ ]addresses:
|Falha[ ]na[ ]entrega[ ]a[ ]estes[ ]destinat.+rios[ ]ou[ ]grupos:
|Uw[ ]bericht[ ]kan[ ]niet[ ]worden[ ]bezorgd[ ]bij[ ]de[ ]volgende[ ]geadresseerden[ ]of[ ]groepen:
)
}x,
};
Expand Down Expand Up @@ -134,7 +156,7 @@ sub inquire {
$v->{'recipient'} = $1;
$recipients++;

} elsif( $e =~ /\AGenerating server: (.+)\z/ ) {
} elsif( $e =~ $markingsof->{'lhost'} ) {
# Generating server: FFFFFFFFFFFF.e0.prod.outlook.com
$permessage->{'lhost'} = lc $1;

Expand Down
1 change: 1 addition & 0 deletions lib/Sisimai/Order.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ sub make {
'non-recapitabile' => ['Sisimai::Lhost::Exchange2007'],
'non-remis' => ['Sisimai::Lhost::Exchange2007'],
'notice' => ['Sisimai::Lhost::Courier'],
'onbestelbaar' => ['Sisimai::Lhost::Office365'],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a subject in Portuguese?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented

'permanent-delivery' => ['Sisimai::Lhost::X4'],
'postmaster-notify' => ['Sisimai::Lhost::Sendmail'],
'returned-mail' => [
Expand Down
1 change: 1 addition & 0 deletions lib/Sisimai/Reason/NotAccept.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sub match {
state $index = [
'host/domain does not accept mail', # iCloud
'host does not accept mail', # Sendmail
'mail receiving disabled',
'name server: .: host not found', # Sendmail
'no mx record found for domain=', # Oath(Yahoo!)
'no route for current request',
Expand Down
1 change: 1 addition & 0 deletions lib/Sisimai/Reason/Suspend.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ sub match {
'has been suspended',
'invalid/inactive user',
'is a deactivated mailbox', # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000742
'is unavailable: user is terminated',
'mailbox currently suspended',
'mailbox is frozen',
'mailbox unavailable or access denied',
Expand Down
1 change: 1 addition & 0 deletions lib/Sisimai/Reason/SystemError.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ sub match {
'loop was found in the mail exchanger',
'loops back to myself',
'mail system configuration error',
'recipient deferred because there is no mdb',
'remote server is misconfigured',
'server configuration error',
'service currently unavailable',
Expand Down
1 change: 1 addition & 0 deletions lib/Sisimai/Reason/VirusDetected.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sub match {
'the message was rejected because it contains prohibited virus or spam content',
'this form of attachment has been used by recent viruses or other malware',
'virus detected',
'virus phishing/malicious_url detected',
'your message was infected with a virus',
];
return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Expand Down
2 changes: 2 additions & 0 deletions xt/612-lhost-amazonses.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ my $isexpected = {
'01027' => [['5.2.2', '552', 'mailboxfull', 0]],
'01028' => [['5.4.7', '', 'expired', 0]],
'01029' => [['5.3.0', '550', 'filtered', 0]],
'01030' => [['2.6.0', '250', 'delivered', 0]],
'01031' => [['2.6.0', '250', 'delivered', 0]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down
2 changes: 2 additions & 0 deletions xt/640-lhost-domino.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ my $isexpected = {
'01015' => [['5.0.0', '', 'networkerror', 0]],
'01016' => [['5.0.0', '', 'systemerror', 0]],
'01017' => [['5.0.0', '', 'userunknown', 1]],
'01018' => [['5.1.1', '', 'userunknown', 1]],
'01019' => [['5.0.0', '', 'userunknown', 1]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down
1 change: 1 addition & 0 deletions xt/652-lhost-exchange2007.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ my $isexpected = {
'01011' => [['5.2.3', '550', 'exceedlimit', 0]],
'01012' => [['5.1.1', '550', 'userunknown', 1]],
'01013' => [['5.0.910', '550', 'filtered', 0]],
'01014' => [['4.2.0', '420', 'systemerror', 0]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down
4 changes: 4 additions & 0 deletions xt/750-lhost-office365.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ my $isexpected = {
'01025' => [['5.1.10', '550', 'userunknown', 1]],
'01026' => [['5.1.10', '550', 'userunknown', 1]],
'01027' => [['5.1.1', '550', 'userunknown', 1]],
'01028' => [['5.1.1', '550', 'userunknown', 1]],
'01029' => [['5.1.1', '550', 'userunknown', 1]],
'01030' => [['5.2.3', '550', 'exceedlimit', 0]],
'01031' => [['5.1.10', '550', 'userunknown', 1]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down
2 changes: 2 additions & 0 deletions xt/760-lhost-postfix.t
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ my $isexpected = {
'01265' => [['5.0.0', '554', 'rejected', 0]],
'01266' => [['5.0.0', '550', 'suspend', 0]],
'01267' => [['5.0.0', '550', 'onhold', 0]], # spamdetected
'01268' => [['5.0.0', '550', 'suspend', 0]],
'01269' => [['5.0.0', '550', 'virusdetected', 0]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down
1 change: 1 addition & 0 deletions xt/791-lhost-sendmail.t
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ my $isexpected = {
'01226' => [['5.7.1', '550', 'rejected', 0]],
'01227' => [['5.7.1', '550', 'rejected', 0]],
'01228' => [['5.1.1', '550', 'userunknown', 1]],
'01229' => [['5.4.1', '550', 'rejected', 0]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down
1 change: 1 addition & 0 deletions xt/890-rfc3464.t
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ my $isexpected = {
'01286' => [['5.5.0', '550', 'rejected', 0]],
'01287' => [['5.0.0', '550', 'filtered', 0]],
'01288' => [['5.0.0', '552', 'exceedlimit', 0]],
'01289' => [['4.0.0', '', 'notaccept', 0]],
};

plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;
Expand Down