From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66490 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Re-importing 'Incomingxxxx' file? Date: Fri, 14 Mar 2008 18:56:58 +0900 Organization: Emacsen advocacy group Message-ID: References: <87zlt1zt0b.fsf@newton.gmurray.org.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1205489010 23973 80.91.229.12 (14 Mar 2008 10:03:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Mar 2008 10:03:30 +0000 (UTC) Cc: ding@gnus.org To: Graham Murray Original-X-From: ding-owner+M14979@lists.math.uh.edu Fri Mar 14 11:03:57 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ja6lO-00036M-0K for ding-account@gmane.org; Fri, 14 Mar 2008 11:03:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Ja6kK-0003Ab-Rm; Fri, 14 Mar 2008 05:02:40 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Ja6fh-000391-9d for ding@lists.math.uh.edu; Fri, 14 Mar 2008 04:57:53 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1Ja6fa-0008Od-VD for ding@lists.math.uh.edu; Fri, 14 Mar 2008 04:57:53 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ja6fh-00048c-00 for ; Fri, 14 Mar 2008 10:57:53 +0100 Original-Received: from [66.225.201.151] (port=47991 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.68) (envelope-from ) id 1Ja6ey-0004Kl-9h; Fri, 14 Mar 2008 04:57:09 -0500 X-Hashcash: 1:20:080314:graham@gmurray.org.uk::SDP1vAMnm0LbAZAl:00000000000000000000000000000000000000005j2F X-Hashcash: 1:20:080314:ding@gnus.org::0GxcI9V2vrPRqx89:00008Kvv X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:ER6nE4RREJo241u5s3GYfaQShRE= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66490 Archived-At: --=-=-= >>>>> Graham Murray wrote: > How do I get gnus to re-spool mail from ~/Mail/Incomingxxxx? > For some reason none of the mails which arrived overnight are showing in > any of my nnml groups, but are all in one of the ~/Mail/Incomingxxx > files. The manual shows how to set up the location of the Incoming files > and how long they are kept, but I could not see any information on how > to get gnus to re-spool from it. > I am running CVS versions of both emacs and gnus How about this? --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defun my-gnus-group-get-mail-from-old-incoming (&optional level) "Re-spool mails from old Incoming* files. The prefix argument LEVEL is a group level, that specifies not to scan groups of which levels are larger than the value. It is useful to give a lower number than those of some groups that are very slow to connect." (interactive "P") (let* ((files (nreverse (sort (directory-files mail-source-directory t (concat "\\`" mail-source-incoming-file-prefix)) #'file-newer-than-file-p))) (mail-sources (mapcar (lambda (incoming) (list 'file :path incoming)) files))) (gnus-group-get-new-news level) (while files (if (zerop (nth 7 (file-attributes (car files)))) (delete-file (car files))) (setq files (cdr files))))) --=-=-= Content-Disposition: inline Invoke this command in the group buffer if you'd like to try it. This command fetches mails from all the Incoming* files as the `file' type `mail-sources'. After fetching mails, those Incoming* files are deleted and new Incoming* files will be generated if `mail-source-delete-incoming' is a number or nil. Consider giving a group level to this command like 1 M-x my-gnus-group-get-mail-from-old-incoming RET if you have the foreign groups that are very slow to connect. Regards, (I'll be absent till Monday.) --=-=-=--