ruby / net-protocol

The abstruct interface for net-* client.
Other
25 stars 21 forks source link

Net::ReadTimeout error on some messages when used with net/smtp #31

Open sdalu opened 1 month ago

sdalu commented 1 month ago

At first it looks like it is related to the pull request https://github.com/ruby/net-protocol/pull/30 But applying the proposed fixed didn't solve it for me case.

2024-07-23 14:09:23 - Net::ReadTimeout - Net::ReadTimeout with #<TCPSocket:(closed)> (Net::ReadTimeout):
        /root/citi-tools/vendors/ruby/3.2/gems/net-protocol-0.2.2/lib/net/protocol.rb:231:in `rbuf_fill'
        /root/citi-tools/vendors/ruby/3.2/gems/net-protocol-0.2.2/lib/net/protocol.rb:201:in `readuntil'
        /root/citi-tools/vendors/ruby/3.2/gems/net-protocol-0.2.2/lib/net/protocol.rb:211:in `readline'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:1017:in `recv_response'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:979:in `block in data'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:1027:in `critical'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:965:in `data'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:799:in `block in send_message'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:926:in `rcptto_list'
        /root/citi-tools/vendors/ruby/3.2/gems/net-smtp-0.5.0/lib/net/smtp.rb:799:in `send_message'
        /root/citi-tools/vendors/ruby/3.2/gems/mail-2.8.1/lib/mail/network/delivery_methods/smtp_connection.rb:53:in `deli
ver!'
astapinski commented 1 month ago

I was just checking on my PRs and you're right that #30 won't help, net-smtp calls readline in this gem which is basically readuntil("\n").chop which is using a single byte line terminator. My PR is for an issue with multiple byte terminators like those used in net-pop so something else must be going on for this issue. Sorry but I'm not a maintainer, I just wanted to state why PR #30 isn't helping here.