Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: POP to IMAP
Date: Tue, 01 Jul 2003 15:33:22 +0200	[thread overview]
Message-ID: <v9ptkucqxp.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <sgdel1b5276.fsf@occarina.pna.cwi.nl>

On Mon, Jun 30 2003, Lute Kamstra wrote:

> Firstly, if you use nnmail-split-fancy-with-parent and still have your
> old POP (nnfolder) mail groups lying around, Gnus recognizes if new
> mails refer to a mail you have in you old archive, but tries to split
> them into a mailbox on the IMAP server with the same name as the group
> the parent is in on the old backend.

Adding the old groups to
`nnmail-split-fancy-with-parent-ignore-groups' should avoid this
problem.

> Thirdly, it took quite some time to move all my archived messages to
> the IMAP server.  I had to go into every group (C-u RET), select all
> messages (M P b), and move (B m) them an IMAP group.[...]  I would
> be nice if there were an easier way to do this.  Maybe there is, but
> I just don't know about it.

You may loop over all relevant groups and let a function do the task.
Something like this:

--8<---------------cut here---------------start------------->8---
(defvar rs-gnus-migrate-old-group-regexp "^nnfolder.*Test"
  "Regexp matching old groups.")
(defvar rs-gnus-migrate-target-group-prefix "nnimap+foo:"
  "Prefix for new groups.")
(defun rs-gnus-migrate-loop ()
  (interactive)
  (let (gnus-large-newsgroup
	gnus-parameters
	case-fold-search
	g-list full method g-name target)
    (dolist (group gnus-newsrc-alist) ;; loop over all groups
      (setq full (car group)
	    g-name (gnus-replace-in-string full "^.*:" "")
	    method (gnus-replace-in-string full (regexp-quote g-name) "")
	    target (concat rs-gnus-migrate-target-group-prefix g-name))
      (when (string-match rs-gnus-migrate-old-group-regexp full)
	(when (string= method "")
	  (setq method nil))
	(gnus-message 8
		      "full=`%s', method=`%s', group=`%s', target=`%s'"
		      full method g-name target)
	;; Create target group next to the old one:
	(gnus-group-jump-to-group full) ;; j
	;; create target group unless it already exists:
	(save-excursion
	  (if (gnus-gethash target gnus-newsrc-hashtb)
	      (gnus-group-jump-to-group target)
	    (gnus-group-make-group
	     g-name
	     ;; FIXME: Use Gnus functions instead of regexps.  Which one?
	     (gnus-replace-in-string rs-gnus-migrate-target-group-prefix
				     "^\\([^+:]*\\).*$" "\\1")
	     (gnus-replace-in-string rs-gnus-migrate-target-group-prefix
				     "^[^+]+\\+\\([^:]+\\).*$" "\\1"))))
	(gnus-group-quick-select-group t) ;; 0 M-RET
	(gnus-summary-toggle-threads t)
	(gnus-summary-sort-by-date) ;; optional
	(gnus-uu-mark-buffer) ;; M P b
	;; Maybe use `-move-' here:
	(gnus-summary-copy-article nil target)
	(gnus-summary-exit)
	;; Maybe unsubscribe/delete old group here:
	;; ...
	(gnus-message 7 "Processed `%s'" g-name)))))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




  reply	other threads:[~2003-07-01 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-27  9:25 Xavier Maillard
2003-06-30  9:45 ` Lute Kamstra
2003-07-01 13:33   ` Reiner Steib [this message]
2003-07-04 14:47     ` Lute Kamstra
2003-07-03 15:24   ` Xavier Maillard

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=v9ptkucqxp.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /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).