Gnus development mailing list
 help / color / mirror / Atom feed
From: NAGY Andras <nagya@inf.elte.hu>
Subject: imap: Garbage: RENEGOTIATING
Date: 30 Dec 2000 17:23:30 +0100	[thread overview]
Message-ID: <87snn5ho8t.fsf@lovi.inf.elte.hu> (raw)

[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]


I'm using openssl to connect to my imap server, and sometimes emacs
prints "Garbage: RENEGOTIATING" and the connection hangs.  Figured out
that actually openssl (OpenSSL 0.9.4 09 Aug 1999) prints this and
confuses imap.el.

The reason is that openssl interprets an R as the first character on a
line as some kind of escape sequence and reacts:

lovi:~% openssl s_client -ssl3 -connect pandora.inf.elte.hu:993
[...]
---
* OK pandora Cyrus IMAP4 v2.0.7 server ready
RABCD  # I type this
RENEGOTIATING
depth=0 /C=HU/ST=Hungary/L=Budapest/O=ELTE/OU=Department of Computer Science/CN=mailbox.inf.elte.hu/Email=root@inf.elte.hu
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=HU/ST=Hungary/L=Budapest/O=ELTE/OU=Department of Computer Science/CN=mailbox.inf.elte.hu/Email=root@inf.elte.hu
verify error:num=21:unable to verify the first certificate
verify return:1
* BYE Error 0
read:errno=0


Using the -quiet option[1] to s_client is the solution:

lovi:~% openssl s_client -quiet -ssl3 -connect pandora.inf.elte.hu:993
[...]
* OK pandora Cyrus IMAP4 v2.0.7 server ready
RABCD
* BAD Invalid tag



Therefore uploading a message matching the regexp "^R" makes the
connection hang.  (At least, sometimes, as most messages stored in my
archive groups are followups, containing a _R_eferences header, but
only a few upload results in garbage: renegotiating.  Can't find the
pattern.)

See attached patch for fix.  Not sure whether this does not break
compatibility with older openssl versions, as the -quiet option might
not be available there.


Andras


[1]

                  -quiet

                     inhibit printing of session and certificate
                     information. This implicitely turns on -ign_eof as
                     well.

                  -ign_eof

                     inhibit shutting down the connection when end of
                     file is reached in the input.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: imap-quiet.diff --]
[-- Type: text/x-patch, Size: 809 bytes --]

diff -u -r6.3 imap.el
--- imap.el	2000/12/19 22:18:56	6.3
+++ imap.el	2000/12/30 16:06:56
@@ -188,10 +188,10 @@
   :group 'imap
   :type '(repeat string))
 
-(defcustom imap-ssl-program '("openssl s_client -ssl3 -connect %s:%p"
-			      "openssl s_client -ssl2 -connect %s:%p"
-			      "s_client -ssl3 -connect %s:%p"
-			      "s_client -ssl2 -connect %s:%p")
+(defcustom imap-ssl-program '("openssl s_client -quiet -ssl3 -connect %s:%p"
+			      "openssl s_client -quiet -ssl2 -connect %s:%p"
+			      "s_client -ssl3 -quiet -connect %s:%p"
+			      "s_client -ssl2 -quiet -connect %s:%p")
   "A string, or list of strings, containing commands for SSL connections.
 Within a string, %s is replaced with the server address and %p with
 port number on server.  The program should accept IMAP commands on

                 reply	other threads:[~2000-12-30 16:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87snn5ho8t.fsf@lovi.inf.elte.hu \
    --to=nagya@inf.elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).