From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/34799 Path: main.gmane.org!not-for-mail From: NAGY Andras Newsgroups: gmane.emacs.gnus.general Subject: nnimap/gssapi/imtest pty stuff Date: 15 Feb 2001 02:51:36 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035170655 32158 80.91.224.250 (21 Oct 2002 03:24:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:24:15 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by mailhost.sclp.com (Postfix) with ESMTP id E06CDD049D for ; Wed, 14 Feb 2001 20:52:33 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.3/8.9.3) with ESMTP id TAC26169; Wed, 14 Feb 2001 19:52:11 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 14 Feb 2001 19:51:17 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id TAA09884 for ; Wed, 14 Feb 2001 19:51:08 -0600 (CST) Original-Received: from mail.inf.elte.hu (mail.inf.elte.hu [157.181.161.6]) by mailhost.sclp.com (Postfix) with ESMTP id 60061D049D for ; Wed, 14 Feb 2001 20:51:37 -0500 (EST) Original-Received: by mail.inf.elte.hu (Postfix, from userid 28535) id C4053808E; Thu, 15 Feb 2001 02:51:36 +0100 (NFT) Original-To: ding@gnus.org User-Agent: Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Biscayne) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 100 Xref: main.gmane.org gmane.emacs.gnus.general:34799 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:34799 Finally, after fixing the calculate-literal-size-first bug, nnimap over imtest seemed to work. While looking at the output of M-x list-processes, I noticed the following line: imap run *nnimap* mailbox /dev/pts/14 /usr/local/bin/bash -c imtest -m gssapi -u nagya -p 143 mailbox.inf.elte.hu That is, imtest has a controlling terminal. My system (AIX 4.3) happens to allocate ptys for user programs with permissions like this: crw-rw-rw- 1 root system 27, 14 Feb 15 02:25 /dev/pts/14 That is, world read/write acces, and no chance to change this. Cat'ting the tty causes commands sent out by imap.el to be output by cat, and imap.el to freeze -- a nice security and denial of service issue. But why use a pty anyway? A pipe would be much simplier and secure. Let's use a pipe then: diff -u -r6.3 imap.el --- imap.el 2000/12/19 22:18:56 6.3 +++ imap.el 2001/02/15 01:33:21 @@ -510,6 +510,7 @@ (let* ((port (or port imap-default-port)) (coding-system-for-read imap-coding-system-for-read) (coding-system-for-write imap-coding-system-for-write) + (process-connection-type nil) (process (start-process name buffer shell-file-name shell-command-switch (format-spec That is, tell emacs not to use any tty (as seen in w3's ssl.el, which is being used for talking with openssl). Of course, it simply hangs. Figured out I should disable imtest's output buffering: --- imtest.c.orig Thu Feb 15 02:22:13 2001 +++ imtest.c Thu Feb 15 02:20:42 2001 @@ -1179,6 +1179,10 @@ int dotls=0; int server_supports_tls; + /* do not buffer output */ + setbuf(stdout, NULL); + setbuf(stderr, NULL); + /* look at all the extra args */ while ((c = getopt(argc, argv, "zvk:l:p:u:a:m:f:r:t:")) != EOF) switch (c) { Seems to work nice, able to browse folders, read messages etc. But when trying to upload the Gcc of a message, it hangs at `Setting marks in nnimap+server:group...'... imap-log contains: 398 APPEND "INBOX.archive.elte.test.group" {634} + go ahead [... text of the message, exaclty as long as stated ...] [... at this point, end of the message, and both emacs and imtest just sit and wait ...] [... I interrupt emacs with C-g, Gnus acts as if something went wrong during sending. I kill the buffer and check for new mail. ...] 399 SELECT "INBOX" [... Gnus sent a command ...] 398 OK [APPENDUID 979734662 12] Completed [... And imtest realizes here it has something to say, and does so (acknowledges the APPEND command) ... ] * FLAGS (\Answered \Flagged \Draft \Deleted \Seen) * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 975409728] * OK [UIDNEXT 2194] 399 OK [READ-WRITE] Completed [... And then replies to and acknowledges the SELECT command ...] 400 UID SEARCH UNSEEN UNDELETED [... Life goes on ...] Interestingly, this works fine if using a pty. Any ideas how to fix this? Andras