summaryrefslogtreecommitdiff
path: root/lib/net/imap.rb
AgeCommit message (Collapse)Author
2021-07-07Fix StartTLS stripping vulnerabilityv2_7_4Yusuke Endoh
Reported by Alexandr Savca in https://hackerone.com/reports/1178562 Co-authored-by: Shugo Maeda <shugo@ruby-lang.org>
2020-01-16lib/net/imap.rb: use `&blk` instead of Kernel#proc with no blockYusuke Endoh
[Bug #16488]
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-04-15Support SNI (Reapplying r67488)knu
This fixes connecting using TLS 1.3 to imap.gmail.com [Fix GH-2077] [Feature #15594] From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10Reverting all commits from r67479 to r67496 because of CI failureskazu
Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Support SNIshugo
This fixes connecting using TLS 1.3 to imap.gmail.com [Fix GH-2077] [Feature #15594] From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02lib/*: Prefer require_relative over require.marcandre
[#15206] [Fix GH-1976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-03Use unpack1 instead of unpack and `[0]`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11net/imap: Fix ArgumentError in send_string_datashugo
Thanks to ShockwaveNN (Pavel Lobashov) for reporting the bug. [ruby-core:86990] [Bug #14750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22net/imap: set SO_KEEPALIVE on TCP socketsnormal
Otherwise connections (commonly on IDLE, but it could be any command) may never receive notifications of link errors. [ruby-core:86628] [Feature #14703] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-27lib/net/imap.rb: Accept continuation requests without response textshugo
The IMAP server of DOCOMO returns such continuation requests. [ruby-list:50558] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-26lib/net/imap.rb: support CHANGEDSINCE and MODSEQshugo
Patch by plehoux (Philippe-Antoine Lehoux). [ruby-core:64272] [Feature #10119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-19lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Servershugo
Based on the patch by keysen (Jérémy Carlier). [ruby-core:81641] [Bug #13649] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22net/imap: separate @continuation_request_exception from @exceptionshugo
Otherwise literal data will be sent even if NO response is returned because @exception is set to nil in receive_responses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19net/imap: Net::IMAP#append should not block when NO response is receivedshugo
[ruby-dev:50129] [Bug#13579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-12net/imap: Revert read_tiemout in r58549.shugo
get_response is called in a receiver thread, so there may be no pending commands when get_response is called. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-11net/imap: Net::IMAP#disconnect need not do anything if already disconnectedshugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-03net/imap: handle timeoutsshugo
Patch by Pavel Rosický. [Feature #13379] [ruby-core:80440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21lib/*: remove closed checksnormal
Follow r56795. Since Ruby 2.2, calling #close on a closed socket no longer raises exceptions. * lib/cgi/session.rb (update): remove closed? check * lib/net/http.rb (finish, transport_request): ditto * lib/net/imap.rb (disconnect): ditto * lib/net/pop.rb (do_start, do_finish): ditto * lib/net/smtp.rb (do_start, do_finish): ditto * lib/open3.rb (popen_run, pipeline_run): ditto * lib/pstore.rb (transaction): ditto * lib/shell/process-controller.rb (sfork): * lib/tempfile (_close, call, Tempfile.create): ditto * lib/webrick/httpauth/htdigest.rb (flush): ditto * lib/webrick/httpauth/htpasswd.rb (flush): ditto * lib/webrick/server.rb (start_thread, cleanup_shutdown_pipe): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-10stdlib: avoid extra calls to eliminate "\n" from Base64normal
We may use the '0' (zero) to avoid adding the line feed. Furthermore, the '*' (asterisk) modifier is not needed for a single-element arrays. * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String): eliminate chomp * lib/net/http.rb (connect): eliminate delete * lib/net/http/header.rb (basic_encode): ditto * lib/net/imap.rb (authenticate): eliminate gsub (self.encode_utf7): shorten delete arg * lib/net/smtp.rb (base64_encode): eliminate gsub * lib/open-uri.rb (OpenURI.open_http): eliminate delete * lib/rss/rss.rb: ditto * lib/securerandom.rb (base64): ditto (urlsafe_base64): eliminate delete! * lib/webrick/httpauth/digestauth.rb (split_param_value): eliminate chop * lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete (setup_upstream_proxy_authentication): ditto [ruby-core:72666] [Feature #11938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23[DOC] Fix typosa_matsuda
* benchmark.rb * getoptlong.rb * irb.rb * net/http.rb * net/http/header.rb * net/imap.rb * optparse.rb * pstore.rb * webrick.rb * xmlrpc.rb [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* lib/net/imap.rb: remove an empty comment line and -*-.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-22* lib/net/imap (idle): add a new argument timeout for keep-alive.shugo
[ruby-core:63693] [Bug #10031] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09* lib/net/imap.rb: use frozen_string_literal: true.shugo
* test/net/imap/test_imap.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08* lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dspshugo
is omitted. [ruby-core:69093] [Bug #11128] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-22* lib/net/imap.rb (move, uid_move): support the MOVE command definedshugo
in RFC6851. Patch by ojab ojab. [ruby-core:68960] [Feature #11077] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-06* lib/net/imap.rb: Fix undefined variable usage & refactor/DRYshugo
code. Patch by @aledovsky. [Fixes GH-770] * test/net/test_imap.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-20* lib/net/imap.rb (Net::IMAP::ResponseParser::BEG_REGEXP): no need to use embbedusa
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* lib/net/imap.rb (search_response): parse MODSEQ in SEARCHshugo
responses properly. [ruby-core:64203] [Bug #10112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-31Document that Net::IMAP#fetch will return nil instead of an emtpy array.knu
* lib/net/imap.rb (Net::IMAP#fetch): [DOC] Document that Net::IMAP#fetch will return nil instead of an emtpy array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-21* lib/net/imap.rb: split executable code into sample directory.hsbt
* sample/net-imap.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-21* lib/net/imap.rb: removed commented-out code.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23* lib/net/imap.rb (Net::IMAP#fetch): [DOC] Describe how a range inknu
+set+ is interpreted, and mention -1 which can be used for '*'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03 * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a bodyshugo
type as "MIXED" followed immediately by params [ruby-core:62864] [Bug #9885] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket whenakr
any exception occur. This fixes a fd leak by IMAPTest#test_imaps_post_connection_check which start_tls_session() raises an exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-02* lib/net/imap.rb: Proofreading docs. [ruby-core:61931][Bug #9720]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05* lib/net/imap.rb (capability_response): should ignore trailingshugo
spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415] * test/net/imap/test_imap_response_parser.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-23* lib/net/imap.rb (getacl_response): parse the mailbox of an ACLshugo
response correctly. [ruby-core:54365] [Bug #8281] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19* lib/net/imap.rb (body_type_msg): should acceptshugo
message/delivery-status with extra data. [ruby-core:53741] [Bug #8167] * test/net/imap/test_imap_response_parser.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17* lib/net/imap.rb: fix Net::IMAP::ResponseParser to acceptshugo
message/delivery-status ([ruby-core:47920] [Bug #7146]), message/rfc822 attachments ([ruby-core:47921] [Bug #7147]), and (BODY ("MIXED")) ([ruby-core:47951] [Bug #7153]). * test/net/imap/test_imap_response_parser.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21remove trainling spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-09* lib/net/imap.rb (decode_utf7, encode_utf7): refactored byshugo
Nobuyoshi Nakada, to use String#encode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07* lib/net/imap.rb (body_type_attachment): parse body typeshugo
"ATTACHMENT". [ruby-core:44849] [Bug #6397] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-23see OpenSSL::SSLnobu
* lib/net/imap.rb (Net::IMAP): see if actually used SSL is defined to get rid of autoloaded OpenSSL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16* lib/net/imap.rb (initialize): raise Net::IMAP::Error when theshugo
connection is closed without a greeting response. [ruby-core:40938] [Bug #5616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16* lib/net/imap.rb (rfc822_text): ignore [] after RFC822.shugo
[ruby-core:40945] [Bug #5620] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e