Skip to content

Commit

Permalink
Fix the minimum and the maximum SMTP Reply code: 221 and 557 in `Sisi…
Browse files Browse the repository at this point in the history
…mai::SMTP::Reply`
  • Loading branch information
azumakuniyuki committed Aug 9, 2024
1 parent 88405c7 commit e119e5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ v5.1.0p1
- Remove unused method `Sisimai::Order.deault` #304
- Fix bug in `Sisimai::Message.tidy()` method #305
- Code improvement in `Sisimai::RFC5322` and `Sisimai::ARF`
- Fix the minimum and the maximum SMTP Reply code: 221 and 557 in `Sisimai::SMTP::Reply`

v5.1.0
---------------------------------------------------------------------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions lib/sisimai/smtp/reply.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# http://www.ietf.org/rfc/rfc5321.txt
# -------------------------------------------------------------------------------------------------
# 4.2.1. Reply Code Severities and Theory
#
# There are four values for the first digit of the reply code:
Expand Down Expand Up @@ -103,8 +104,9 @@ class << self
# 554 Transaction failed (Or, in the case of a connection-opening response, "No SMTP service here")
# 555 MAIL FROM/RCPT TO parameters not recognized or not implemented
# 556 Domain does not accept mail (See RFC7504)
# 557 draft-moore-email-addrquery-01
'550', '552', '553', '551', '521', '525', '502', '520', '523', '524', '530', '533', '534',
'535', '538', '551', '555', '556', '554', '500', '501', '502', '503', '504',
'535', '538', '551', '555', '556', '554', '557', '500', '501', '502', '503', '504',
].freeze
CodeOfSMTP = { '2' => ReplyCode2, '4' => ReplyCode4, '5' => ReplyCode5 }.freeze

Expand All @@ -119,8 +121,8 @@ def test(argv1 = '')
reply = argv1.to_i
first = (reply / 100).to_i

return false if reply < 200
return false if reply > 599
return false if reply < 211
return false if reply > 557
return false if reply % 100 > 59

if first == 2
Expand Down

0 comments on commit e119e5c

Please sign in to comment.