We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I noticed that Net::SMTPFatalError exceptions do not contain the full server response error lines.
Net::SMTPFatalError
To test if a SMTP server is rejecting SPF failing messages, I created the following debug snippet with net/smtp:
require 'net/smtp' smtp = Net::SMTP.new('[REDACTED]', 25) smtp.set_debug_output STDERR error_msg = nil smtp.start() do |smtp_connection| begin smtp_connection.send_message '', '[email protected]', '[REDACTED]' rescue Net::SMTPFatalError => e error_msg = e end end STDERR.puts error_msg
This shows the following SMTP transaction, when the mail is rejected. Notice the two lines containing the SMTP 550 error response.
[...] <- "MAIL FROM:<[email protected]>\r\n" -> "550-SPF-check failed:\r\n" -> "550 example.com does not allow sending mails from [REDACTED]\r\n" <- "QUIT\r\n" -> "221 [REDACTED] closing connection\r\n"
But STDERR.puts error_msg only prints the first error line:
STDERR.puts error_msg
550-SPF-check failed:
The text was updated successfully, but these errors were encountered:
After #26, you will be abel to:
rescue Net::SMTPFatalError => e error_msg = e.response.string end
Sorry, something went wrong.
No branches or pull requests
I noticed that
Net::SMTPFatalError
exceptions do not contain the full server response error lines.To test if a SMTP server is rejecting SPF failing messages, I created the following debug snippet with net/smtp:
This shows the following SMTP transaction, when the mail is rejected. Notice the two lines containing the SMTP 550 error response.
But
STDERR.puts error_msg
only prints the first error line:The text was updated successfully, but these errors were encountered: