From: karis10@...5foster.com Date: 2018-11-19T08:26:03+00:00 Subject: [ruby-core:89870] [Ruby trunk Bug#15318] net/imap socket backward compatibility broken in ruby 2.5+ Issue #15318 has been updated by karis10 (bug reporter). nobu (Nobuyoshi Nakada) wrote: > Could you elaborate how it is broken? Sure. ~~~ ruby require 'net/imap' require 'net/pop' require 'socksify' Socksify::debug = true Socksify::proxy('127.0.0.1', 1080) do |_| # in ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux] connection will go throgh socks # in ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux] connection will be from current host, omitting socks without any error or warning imap = Net::IMAP.new('imap.host.com', 143) # in ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux] connection will go throgh socks # in ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux] connection will go throgh socks pop = Net::POP3.new('pop3.host.com', 110) end ~~~ ---------------------------------------- Bug #15318: net/imap socket backward compatibility broken in ruby 2.5+ https://bugs.ruby-lang.org/issues/15318#change-74932 * Author: karis10 (bug reporter) * Status: Feedback * Priority: Normal * Assignee: shugo (Shugo Maeda) * Target version: * ruby -v: * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- Hi, I use net/pop and net/imap libraries and sometimes I need my pop/imap connections to be socksified or proxified (through TCPSocket initialize method modifications: https://github.com/Shopify/socksify-ruby). Upgrading to ruby 2.5.3 from 2.4.4 I've found that TCPSocket interface was changed in favor of raw sockets by this patch: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/58549/diff/lib/net/imap.rb the reason was this issue: https://bugs.ruby-lang.org/issues/13379 And after migrating from 2.4.4 to 2.5.3 and a bit of debugging I've found that standard library behavior was internally _silently_ broken. In 2.5.3 net/pop library still can be normally proxified, but not net/imap. -- https://bugs.ruby-lang.org/ Unsubscribe: