From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86162 Path: news.gmane.org!not-for-mail From: asjo@koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Newsgroups: gmane.emacs.gnus.general Subject: Re: Using IMAP as POP, :mailbox taking a list? Date: Fri, 04 Sep 2015 12:30:35 +0200 Organization: koldfront - analysis & revolution, Copenhagen, Denmark Message-ID: <874mjaxyr8.fsf@tullinup.koldfront.dk> References: <87si6uy55n.fsf@tullinup.koldfront.dk> <878u8mo6js.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1441362719 8122 80.91.229.3 (4 Sep 2015 10:31:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Sep 2015 10:31:59 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34396@lists.math.uh.edu Fri Sep 04 12:31:46 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZXoHV-0001k5-J8 for ding-account@gmane.org; Fri, 04 Sep 2015 12:31:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1ZXoGn-0001Ja-Fz; Fri, 04 Sep 2015 05:30:57 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZXoGl-0001J7-Nc for ding@lists.math.uh.edu; Fri, 04 Sep 2015 05:30:55 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZXoGj-00017P-Ug for ding@lists.math.uh.edu; Fri, 04 Sep 2015 05:30:55 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZXoGh-0004fA-U5 for ding@gnus.org; Fri, 04 Sep 2015 12:30:51 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZXoGY-0000x0-DK for ding@gnus.org; Fri, 04 Sep 2015 12:30:42 +0200 Original-Received: from virgil.koldfront.dk ([2.110.51.43]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Sep 2015 12:30:42 +0200 Original-Received: from asjo by virgil.koldfront.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Sep 2015 12:30:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: virgil.koldfront.dk OpenPGP: id=49D0746121BDE416; url=http://asjo.koldfront.dk/gpg.asc Mail-Follow-Up-To: never X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,Q(^@xk}n4Ou rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ ^St'=VZBR Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86162 Archived-At: Andreas writes: > Looks doable, see mail-source-fetch-imap. You probably just need to add > a loop over mailbox. Yeah, I have got it working with this change: --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -1090,10 +1090,13 @@ This only works when `display-time' is enabled." (if (and (imap-open server port stream authentication buf) (imap-authenticate user (or (cdr (assoc from mail-source-password-cache)) - password) buf) - (imap-mailbox-select mailbox nil buf)) + password) buf)) + (let ((mailbox-list (if (listp mailbox) mailbox (list mailbox)))) + (dolist (mailbox mailbox-list) + (when (imap-mailbox-select mailbox nil buf) (let ((coding-system-for-write mail-source-imap-file-coding-system) str) + (message (format "Fetching from %s..." mailbox)) (with-temp-file mail-source-crash-box ;; Avoid converting 8-bit chars from inserted strings to ;; multibyte. @@ -1128,8 +1131,7 @@ This only works when `display-time' is enabled." fetchflag nil buf)) (if dontexpunge (imap-mailbox-unselect buf) - (imap-mailbox-close nil buf)) - (imap-close buf)) + (imap-mailbox-close nil buf)))))) (imap-close buf) ;; We nix out the password in case the error ;; was because of a wrong password being given. Now I just need to document and wrap it up nicely; I hope :-) It is incredible how much writing about what you (I) can't figure out motivates... Best regards, Adam -- "Vi er fanget i en kø Adam Sjøgren I lys og nærkontakt. asjo@koldfront.dk Hun sir at vi skal dø Det gad jeg ikke have sagt"