-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style(rubocop): Style/ClassAndModuleChildren
- Loading branch information
Showing
1 changed file
with
29 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,42 @@ | ||
# frozen_string_literal: true | ||
|
||
class Net::SMTP::Response | ||
module Net | ||
class SMTP | ||
|
||
def message | ||
@string | ||
end | ||
attr_accessor :source_address | ||
|
||
end | ||
def secure_socket? | ||
@socket.io.is_a?(OpenSSL::SSL::SSLSocket) | ||
end | ||
|
||
class Net::SMTP | ||
# | ||
# We had an issue where a message was sent to a server and was greylisted. It returned | ||
# a Net::SMTPUnknownError error. We then tried to send another message on the same | ||
# connection after running `rset` the next message didn't raise any exceptions because | ||
# net/smtp returns a '200 dummy reply code' and doesn't raise any exceptions. | ||
# | ||
def rset | ||
@error_occurred = false | ||
getok("RSET") | ||
end | ||
|
||
attr_accessor :source_address | ||
def rset_errors | ||
@error_occurred = false | ||
end | ||
|
||
def secure_socket? | ||
@socket.io.is_a?(OpenSSL::SSL::SSLSocket) | ||
end | ||
private | ||
|
||
# | ||
# We had an issue where a message was sent to a server and was greylisted. It returned | ||
# a Net::SMTPUnknownError error. We then tried to send another message on the same | ||
# connection after running `rset` the next message didn't raise any exceptions because | ||
# net/smtp returns a '200 dummy reply code' and doesn't raise any exceptions. | ||
# | ||
def rset | ||
@error_occurred = false | ||
getok("RSET") | ||
end | ||
def tcp_socket(address, port) | ||
TCPSocket.open(address, port, source_address) | ||
end | ||
|
||
def rset_errors | ||
@error_occurred = false | ||
end | ||
class Response | ||
|
||
private | ||
def message | ||
@string | ||
end | ||
|
||
def tcp_socket(address, port) | ||
TCPSocket.open(address, port, source_address) | ||
end | ||
end | ||
|
||
end | ||
end |