From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53828 Path: main.gmane.org!not-for-mail From: Gaute B Strokkenes Newsgroups: gmane.emacs.gnus.general Subject: Re: Problems with IMAP-over-ssl mail source. Date: Tue, 26 Aug 2003 20:34:32 +0100 Organization: The Church of Emacs Sender: ding-owner@lists.math.uh.edu Message-ID: <87n0dw5i2f.fsf@srcf.ucam.org> References: <87el0tubbg.fsf@cam.ac.uk> <87isq5mtkk.fsf@cam.ac.uk> <87vfu39rcz.fsf@cam.ac.uk> <874r06winx.fsf@srcf.ucam.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1061926567 27943 80.91.224.253 (26 Aug 2003 19:36:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Aug 2003 19:36:07 +0000 (UTC) Cc: larsi@gnus.org Original-X-From: ding-owner+M2368@lists.math.uh.edu Tue Aug 26 21:36:05 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19rjbp-0000E3-00 for ; Tue, 26 Aug 2003 21:36:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19rjbi-0002Iq-00; Tue, 26 Aug 2003 14:35:58 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19rjbe-0002Il-00 for ding@lists.math.uh.edu; Tue, 26 Aug 2003 14:35:54 -0500 Original-Received: (qmail 92785 invoked by alias); 26 Aug 2003 19:35:54 -0000 Original-Received: (qmail 92775 invoked from network); 26 Aug 2003 19:35:53 -0000 Original-Received: from mta05-svc.ntlworld.com (62.253.162.45) by sclp3.sclp.com with SMTP; 26 Aug 2003 19:35:53 -0000 Original-Received: from belldandy ([81.100.93.186]) by mta05-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20030826193547.XJBV7553.mta05-svc.ntlworld.com@belldandy>; Tue, 26 Aug 2003 20:35:47 +0100 Original-Received: from gs234 by belldandy with local (Exim 3.36 #1 (Debian)) id 19rjaK-0002Yq-00; Tue, 26 Aug 2003 20:34:32 +0100 Mail-Copies-To: never Original-To: ding@gnus.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEWWWBTly7aGMwb+/vz9 +ffIilb///+yaCxNCwHGVC3gAAACU0lEQVR4nF2TQWvjMBBGVUGwj3WxaY/aAWNfi0zuwZPuHp0Q ob079OwYjHrsChb0s3dGctJ0ddTzm9F8lsR7WiNiWWL/flviul9Uh0NR4vY/gJUxJjOEtt/AubBy UsotRfH2DbxWE0hom3w5XJUEKis9hACt2hR4B86VDOtqTNHfgeEGvLiUN7Ddze26Dx6y1CUa+ygo NwFQm0N/BeMzCZAtNIoQrd9EhcH5mWpnztB8ZpJBlH23jaAbuE4EhZ2Bam0TeJ0DRMCKVP6CegWk q4z2TVFUx0946FOPcSe9ELE3rSHAj15rBuddS0C4BGyAutfpVAQkKdZOQiwMMIHxlUDrgeej5Ns7 I/ccSWNBLda1XwYBEG1Qswy1yXJf879nA4cjkNI0H+FzoUyuRodPA5eqZwFONG34i30ccOxeKFUy flNe1szqsgLdvXwKCj6zjTXODHV9M46gZPCLlYKCGTYO8S0aOAvJzRfD0w+1XcGIsxLUw/sYl5sM 9n0yjkoSUDOByrijwRRiAq13NhqLJYB3ACazrgN2bIwanyJQKXhHAJPRPQruEaCJP2Shy4DJ2As+ FQjJZH7AZIy6w0pQiiRYAh8nTEZHYDfRqSDeB5OXq4EEcAC4NocvoBl4+n1cyl54nyLRNA3iIwRP wNGFOK1g1Gz8jNfaCjdtqJLm2LXuqMc+50cDIJQpr6X0OHa4X58ULAw03QbRd7GUiG/K04mj0bNB xQhwJkEsJiZ1Bbgb6CnF79cBE+jwF91qniOCP3fghUFKxOShjIATw/wOfIQTg39LpFHtxhlKywAA AABJRU5ErkJggg== User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:53828 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:53828 On 25 aug 2003, biggaute@uwc.net wrote: > Consider the following snippet from mail-source-fetch-imap: > > (let* ((from (format "%s:%s:%s" server user port)) > (found 0) > (buffer-name " *imap source*") > (buf (get-buffer-create (generate-new-buffer-name buffer-name))) > (mail-source-string (format "imap:%s:%s" server mailbox)) > (imap-shell-program (or (list program) imap-shell-program)) > remove) > (if (and (imap-open server port stream authentication buffer-name) > (imap-authenticate > user (or (cdr (assoc from mail-source-password-cache)) > password) buf) > (imap-mailbox-select mailbox nil buf)) > > The problem appear to be that the " *imap source*" buffer is not > deleted when I interrupt a fetching session. Then, the next time > this code is called, generate-new-buffer-name ensures that `buf' is > a new buffer called " *imap source*<1>". However, when imap-open is > called it is passed buffer-name which is still set to " *imap > source", causing imap-open to operate on the wrong temporary buffer. And the obvious fix is: Index: lisp/mail-source.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mail-source.el,v retrieving revision 6.38 diff -u -r6.38 mail-source.el --- lisp/mail-source.el 14 Jul 2003 08:03:13 -0000 6.38 +++ lisp/mail-source.el 25 Aug 2003 20:51:52 -0000 @@ -968,12 +968,11 @@ (mail-source-bind (imap source) (let* ((from (format "%s:%s:%s" server user port)) (found 0) - (buffer-name " *imap source*") - (buf (get-buffer-create (generate-new-buffer-name buffer-name))) + (buf (generate-new-buffer " *imap source*")) (mail-source-string (format "imap:%s:%s" server mailbox)) (imap-shell-program (or (list program) imap-shell-program)) remove) - (if (and (imap-open server port stream authentication buffer-name) + (if (and (imap-open server port stream authentication buf) (imap-authenticate user (or (cdr (assoc from mail-source-password-cache)) password) buf) But I'm not sure that this is the best way to fix things. Is it correct to leave a " *imap source*" buffer lying about if mail-source-fetch-imap is interupted? Would it be better to reuse it than to create a new one? Lastly, this bug was introduced by Lars in mid-March: revision 6.33 date: 2003/03/17 14:20:35; author: larsi; state: Exp; lines: +8 -7 * mail-source.el (mail-source-fetch-imap): Pass buffer-name to imap-open. I've been unable to find discussion of why this change was made on the ding list, though presumably there is some reason for it. Lars? -- Gaute Strokkenes http://www.srcf.ucam.org/~gs234/ The PINK SOCKS were ORIGINALLY from 1952!! But they went to MARS around 1953!!