Skip to content

Commit

Permalink
Merge 5268014 into 7aaa130
Browse files Browse the repository at this point in the history
  • Loading branch information
azumakuniyuki committed Dec 17, 2019
2 parents 7aaa130 + 5268014 commit b213087
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 15 deletions.
31 changes: 27 additions & 4 deletions lib/sisimai/lhost/einsundeins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,39 @@ def make(mhead, mbody)
# For the following reason:
v['diagnosis'] = e
else
# Get error message and append error message strings
v['diagnosis'] << ' ' << e if v['diagnosis']
if v['diagnosis']
# Get error message and append error message strings
v['diagnosis'] << ' ' << e
else
# OR the following format:
# neko@example.fr:
# SMTP error from remote server for TEXT command, host: ...
v['alterrors'] ||= ''
v['alterrors'] << ' ' << e
end
end
end
end
return nil unless recipients > 0

dscontents.each do |e|
e['agent'] = self.smtpagent
e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'].to_s.gsub(/\A#{StartingOf[:error][0]}/, ''))
e['agent'] = self.smtpagent
e['diagnosis'] ||= ''
e['diagnosis'] = e['alterrors'] if e['diagnosis'].empty?

if cv = e['diagnosis'].match(/host:[ ]+(.+?)[ ]+.+[ ]+reason:.+/)
# SMTP error from remote server for TEXT command,
# host: smtp-in.orange.fr (193.252.22.65)
# reason: 550 5.2.0 Mail rejete. Mail rejected. ofr_506 [506]
e['rhost'] = cv[1]
e['command'] = 'DATA' if e['diagnosis'] =~ /for TEXT command/
e['spec'] = 'SMTP' if e['diagnosis'] =~ /SMTP error/
e['status'] = Sisimai::SMTP::Status.find(e['diagnosis'])
else
# For the following reason:
e['diagnosis'].gsub(/\A#{StartingOf[:error][0]}/, '')
end
e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])

MessagesOf.each_key do |r|
# Verify each regular expression of session errors
Expand Down
6 changes: 3 additions & 3 deletions lib/sisimai/lhost/postfix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ def make(mhead, mbody)
e['lhost'] ||= permessage['rhost']
permessage.each_key { |a| e[a] ||= permessage[a] || '' }

e['agent'] = self.smtpagent
e['command'] = commandset.shift || ''

if anotherset['diagnosis']
# Copy alternative error message
e['diagnosis'] = anotherset['diagnosis'] unless e['diagnosis']
Expand Down Expand Up @@ -247,7 +244,10 @@ def make(mhead, mbody)
end

e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
e['command'] = commandset.shift || nil
e['command'] ||= 'HELO' if e['diagnosis'] =~ /refused to talk to me:/
e['spec'] ||= 'SMTP' if e['diagnosis'] =~ /host .+ said:/
e['agent'] = self.smtpagent
e.each_key { |a| e[a] ||= '' }
end

Expand Down
6 changes: 4 additions & 2 deletions lib/sisimai/rhost/franceptt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module FrancePTT
class << self
# Imported from p5-Sisimail/lib/Sisimai/Rhost/FrancePTT.pm
ErrorCodes = {
'102' => 'blocked', # 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam. Client host blocked for spamming issues. OFR006_102 Ref
'103' => 'blocked', # Service refuse. Veuillez essayer plus tard.
'104' => 'toomanyconn', # Too many connections, slow down. LPN105_104
'105' => nil, # Veuillez essayer plus tard.
Expand All @@ -26,6 +27,7 @@ class << self
'421' => 'rejected', # 5.5.3 Mail from not owned by user. LPN105_421.
'423' => nil, # Service refused, please try later. LPN105_423
'424' => nil, # Veuillez essayer plus tard. LPN105_424
'426' => 'suspend', # 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked. LPN007_426
'506' => 'spamdetected', # Mail rejete. Mail rejected. OFR_506 [506]
'510' => 'blocked', # Veuillez essayer plus tard. service refused, please try later. LPN004_510
'513' => nil, # Mail rejete. Mail rejected. OUK_513
Expand All @@ -41,8 +43,8 @@ def get(argvs)
statusmesg = argvs.diagnosticcode
reasontext = ''

if cv = statusmesg.match(/\b(LPN|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/)
# OUK_513, LPN105-104, OFR102-104
if cv = statusmesg.match(/\b(LPN|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i)
# OUK_513, LPN105-104, OFR102-104, ofr_506
v = sprintf("%03d", (cv[1] + cv[2])[-3, 3])
reasontext = ErrorCodes[v] || 'undefined'
end
Expand Down
66 changes: 66 additions & 0 deletions set-of-emails/maildir/bsd/email-einsundeins-03.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Return-Path: <>
From: "Mail Delivery System" <mailer-daemon@kundenserver.de>
To: xxxx@xxxx.fr
Subject: Mail delivery failed: returning message to sender
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-UI-Out-Filterresults: unknown:0;V03:K0:Kcn/zdAZw0Y=:T7VNfNUTHnyf4qzwjmCtIA
==

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of
its recipients. This is a permanent error. The following address(es)
failed:

xxxx@xxxx.fr:
SMTP error from remote server for TEXT command, host: smtp-in.orange.fr (193.252.22.65) reason: 550 5.2.0 Mail rejete. Mail rejected. ofr_506 [506]



--- The header of the original message is following. ---

Received: from [212.227.15.41] ([212.227.15.41]) by mx.kundenserver.de
(mxeue010 [212.227.15.41]) with ESMTP (Nemesis) id 1MQvwN-1iJ0J61sAR-00O9vb
for <xxxx@xxxxx.fr>; Mon, 16 Dec 2019 14:22:07 +0100
Received: from regiesmtp1792-2.odiso.net ([185.251.132.146]) by
mx.kundenserver.de (mxeue010 [212.227.15.41]) with ESMTP (Nemesis) id
1MOBJp-1iMreo1s6L-00OhMP for <xxxx@xxxx.com>; Mon, 16 Dec 2019 14:22:07
+0100
Message-Id: <1576497267.@xxxx.xxxx>
Feedback-Id: 22:1693
Precedence: bulk
From: <xxxx@xxxx.fr>
To: xxxx@xxxx.com
Reply-To: <xxxxx@xxxx.fr>
Content-Type: text/html; charset=utf-8
Subject: xxxxxx
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0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v67B+XqQWtEnKU5naxGZK+8nglSKjCemO5jCe5duETtLLBMtblE9
IGhQs23v8JQBc+gfqBXRcLcrt6NCcHI2JLr6EPWCmhFW9ftVDn0P8W12dnwdrIfQ6gP744Fe5
EAi4HFGFkQMBKs4zI9VMbu0gIwut7QsZzS7lzpOcZgQzeTF+X2RsyhWXjFkfrXq2MwsuldC48
O6g42PJkE6z1jlt+7Vg+r2xDyybq6dubLUzxgQyGUJ295sFKI3A3igccSUN8pz5ZNdGmxUShs
wugaqOcxx2ekbo1Sr8agWIYuTYkC3OGu6CerZDS/LdbQpNywpWtvGreFKmYbuqYEzazY1WT5J
qpMi1jdgw+iEv0f9FLeUDxIxLI7PNSeQnoVGksGQvWmiWkkaknQ=


66 changes: 66 additions & 0 deletions set-of-emails/maildir/bsd/rhost-franceptt-04.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Return-Path: <>
From: "Mail Delivery System" <mailer-daemon@kundenserver.de>
To: xxxx@xxxx.fr
Subject: Mail delivery failed: returning message to sender
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-UI-Out-Filterresults: unknown:0;V03:K0:Kcn/zdAZw0Y=:T7VNfNUTHnyf4qzwjmCtIA
==

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of
its recipients. This is a permanent error. The following address(es)
failed:

xxxx@xxxx.fr:
SMTP error from remote server for TEXT command, host: smtp-in.orange.fr (193.252.22.65) reason: 550 5.2.0 Mail rejete. Mail rejected. ofr_506 [506]



--- The header of the original message is following. ---

Received: from [212.227.15.41] ([212.227.15.41]) by mx.kundenserver.de
(mxeue010 [212.227.15.41]) with ESMTP (Nemesis) id 1MQvwN-1iJ0J61sAR-00O9vb
for <xxxx@xxxxx.fr>; Mon, 16 Dec 2019 14:22:07 +0100
Received: from regiesmtp1792-2.odiso.net ([185.251.132.146]) by
mx.kundenserver.de (mxeue010 [212.227.15.41]) with ESMTP (Nemesis) id
1MOBJp-1iMreo1s6L-00OhMP for <xxxx@xxxx.com>; Mon, 16 Dec 2019 14:22:07
+0100
Message-Id: <1576497267.@xxxx.xxxx>
Feedback-Id: 22:1693
Precedence: bulk
From: <xxxx@xxxx.fr>
To: xxxx@xxxx.com
Reply-To: <xxxxx@xxxx.fr>
Content-Type: text/html; charset=utf-8
Subject: xxxxxx
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Date: Mon, 16 Dec 2019 12:54:27 +0100
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:bNR20cJ6slw=:420XAXjcgAf15+npPybzpF
kCV+AJjbiKSMG3sAhI9YjJfQ8gB/i66pY1cU7g3Rz+By/+na6v7UbFidb17A8ug8KeOMFyHza
tJ8DfnOPaq+jEWytlpOQ+xzTRIYersZFYLsATQQGU+IFqs5ftFir5JllSf2rvkAuUOqGdh94P
okuFRqflpoKOw0ChfgwNzgW/UYsdHoZL/JRzR24NnoeoTnIp8oWstELobGnLrT3CJeOesuGW/
4lpi0xouFF5woDYUE2zVuBHKNteM5U6sqLgL/S4+tIj62V9exm0Z4woutbQBBrdmDn945Q+MU
XoFQtVuDxiZUYTLpCRbUHzCL9R9dYdClzbR2VVWTxjmpMNEsFcIn1mqkU8N+wroz3u8YC2R8h
s8j7gLFDx3kx8xL5b7yoyaj/KyHWf2DfyBA/qfQrjeCgm9Jz+CWrq6IyyjdAI/Eu+21ahc6og
W0QsYKrdDJKNPMEm3WCzX09sfKTgUYzfVzttRl2xU7cJxW2mv194qzDWr2fQSIuntnM6MN2NQ
skoPfZFkFr8v9hlyIuIr7zfsqGeRBscmpvh2NVqg0LOTvQnZBDUNrPtmoROX0dviHfKUVG+UT
FwVv6XuJyqcUlcTrS7CLg8Jo7mpy+67Mys0+RRA+Iw6D9J0HnH24ktG57c7whPI0jpLDXE8o2
njmUJpmJPpBLcNllcuXQntI1pShnl0rG6ILvXcTi5nZ7EU2WbzgWzoE3ZbSWu4cwYywz5e4nw
8USo8EZhGbwwyoPs2UojquXB7tRtMPFoIr17c1+KU6BEw3xNhhrakrXElxaYgqhpU1JxUtiEA
eIjbL1XPkzDX/HjEDG0qwUBxN16BVZvV1l/st3lhDfgRSAqbnEU3EEyqkER3RwPTJszRoh/u8
LIlXhSswmJG2A/OqhbVnyZAsr+UX/TAi6aEFcfjzy89NTKR6qhhlC97kca4dRA81VFI3dYjBg
rv421zHHGAymgpixtDXlcv67B+XqQWtEnKU5naxGZK+8nglSKjCemO5jCe5duETtLLBMtblE9
IGhQs23v8JQBc+gfqBXRcLcrt6NCcHI2JLr6EPWCmhFW9ftVDn0P8W12dnwdrIfQ6gP744Fe5
EAi4HFGFkQMBKs4zI9VMbu0gIwut7QsZzS7lzpOcZgQzeTF+X2RsyhWXjFkfrXq2MwsuldC48
O6g42PJkE6z1jlt+7Vg+r2xDyybq6dubLUzxgQyGUJ295sFKI3A3igccSUN8pz5ZNdGmxUShs
wugaqOcxx2ekbo1Sr8agWIYuTYkC3OGu6CerZDS/LdbQpNywpWtvGreFKmYbuqYEzazY1WT5J
qpMi1jdgw+iEv0f9FLeUDxIxLI7PNSeQnoVGksGQvWmiWkkaknQ=


96 changes: 96 additions & 0 deletions set-of-emails/maildir/bsd/rhost-franceptt-05.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
Return-Path: <>
Delivered-To: xxxx@xxxx.net
Received: by xxxx.net (Postfix)
id EF1C23286A2; Tue, 17 Dec 2019 08:13:44 +0100 (CET)
Delivered-To: xxxx@xxxx.net
Received: from xxxx.net (unknown [10.0.0.1])
by xxxx.xxxx.net (Postfix) with ESMTP id EDDC032869C
for <xxxx@xxxx.com>; Tue, 17 Dec 2019 08:13:44 +0100 (CET)
Received: by xxxx.xxxx.net (Postfix)
id EC450123FF328; Tue, 17 Dec 2019 08:13:44 +0100 (CET)
Date: Tue, 17 Dec 2019 08:13:44 +0100 (CET)
From: MAILER-DAEMON@xxxx.xxxx.net (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: xxxx@xxxx.com
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="C56F3123FEEAF.1576566824/xxxx.xxxx.net"
Content-Transfer-Encoding: 8bit
Message-Id: <20191217071344.EC450123FF328@xxxx.xxxx.net>

This is a MIME-encapsulated message.

--C56F3123FEEAF.1576566824/xxxx.xxxx.net
Content-Description: Notification
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
This is the mail system at host xxxx.xxxx.net.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<xxxx@laposte.net>: host smtpz4.laposte.net[194.117.213.1] said: 550
5.5.0 Le compte du destinataire est bloque. The recipient account is
blocked. LPN007_426 (in reply to RCPT TO command)
--C56F3123FEEAF.1576566824/xxxx.xxxx.net
Content-Description: Delivery report
Content-Type: message/delivery-status
Reporting-MTA: dns; xxxx.xxxx.net
X-Postfix-Queue-ID: C56F3123FEEAF
X-Postfix-Sender: rfc822; xxxx@xxxx.com
Arrival-Date: Tue, 17 Dec 2019 08:13:41 +0100 (CET)
Final-Recipient: rfc822; xxxx@laposte.net
Original-Recipient: rfc822;xxxx@laposte.net
Action: failed
Status: 5.5.0
Remote-MTA: dns; smtpz4.laposte.net
Diagnostic-Code: smtp; 550 5.5.0 Le compte du destinataire est bloque. The
recipient account is blocked. LPN007_426
--C56F3123FEEAF.1576566824/xxxx.xxxx.net
Content-Description: Undelivered Message
Content-Type: message/rfc822
Content-Transfer-Encoding: 8bit
Return-Path: <xxxx@xxxx.com>
Message-Id: <1576566821.xxxx@xxxx.com>
Feedback-Id: 4214:504
Precedence: bulk
From: <xxxx@xxxx.com>
To: xxxx@laposte.net
Content-Type: multipart/alternative; boundary="_----------=_157656682151791"
Subject: xxxxx
Content-Transfer-Encoding: binary
MIME-Version: 1.0
Date: Tue, 17 Dec 2019 08:13:41 +0100
This is a multi-part message in MIME format.
--_----------=_157656682151791
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
xxxxx
--_----------=_157656682151791
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=utf-8

xxxxx

--_----------=_157656682151791--

--C56F3123FEEAF.1576566824/xxxx.xxxx.net--
Loading

0 comments on commit b213087

Please sign in to comment.