Gnus development mailing list
 help / color / mirror / Atom feed
From: Bob Newell <bobnewell@bobnewell.net>
To: ding <ding@gnus.org>
Subject: Moving mail generates 'quit' signal
Date: Wed, 18 Mar 2020 20:03:43 -1000	[thread overview]
Message-ID: <871rpoubi8.fsf@emailmessageidheader.nil> (raw)

Aloha,

I've started to fetch mail from two secondary sources. One is
an IMAP server and all is well. The other is POP only and I've
run into an odd issue.

I have a function that I call after fetching to move mail from
the inbox of the secondary source to my gmail inbox, so
everything will be in the same place in the end. For the
secondary IMAP server this works but for the POP server, I get
a 'quit' condition, which I'm unable to completely trace thus
far.

Here's the operative code in question.

First the POP server setup, pretty standard.

  (add-to-list 'gnus-secondary-select-methods '(nnml "pop.netzero.com"))
  (setq mail-sources '((pop :server "pop.netzero.com"
                             :user "thatwouldbeme"
                             :password "highlysecret"
			     :port 110
			     )
			    ))

Now the move mail stuff. This is a little long but the quit
condition arises below in gnus-group-read-group, when I call
like this:

(rjn-do-mail-move "nnml+pop.netzero.com:mail.misc" "nnimap+imap.gmail.com:INBOX")

The quit condition is only when there is no mail to move. If
there is mail to move, it works fine. I've taken to
surrounding the line above like so:

(condition-case quit
    (rjn-do-mail-move "nnml+pop.netzero.com:mail.misc" "nnimap+imap.gmail.com:INBOX")
  (quit nil))
  )

This makes the problem go away but doesn't tell me why I have
it. Here's the rest of the code.

(defun rjn-do-mail-move (frombox tobox)
 "Move mail between mailboxes, even if between different IMAP
servers"
 (save-window-excursion
   ;; This selects the 'from' group if there is anything in it,
   ;; returning t.  If nothing in the group, return nil and do nothing
   ;; further. Note, we are not counting unread articles, we are
   ;; counting read AND unread, so gnus-group-unread won't work. We
   ;; move ALL articles, even old ones.

   ;; gnus-group-read-group seemingly returns t if there is
   ;; anything in the group and nil if not. But a quit
   ;; condition apparently arises if the 'frombox' is an nnml
   ;; group which is empty.
   
    (if (gnus-group-read-group 9999 t frombox)
       ;; We have articles (mail, maybe) to move.
       (progn
	 ;; Mark all articles with process mark.
	 (gnus-uu-mark-buffer)
	 ;; Move them in bulk to the 'to' group.
	 (gnus-summary-move-article nil tobox nil)
	 ;; Mark the 'from' group as caught up.
	 (gnus-summary-catchup t t)
         ;; Leave the 'from' group.
	 (gnus-summary-exit)
	 ;; Reset the group display to what it normally would be.
	 (gnus-group-list-groups)))))

I know this is weird and obscure but if anyone has an idea I'd
be most appreciative.

-- 
Bob Newell
Honolulu, Hawai`i
- Via Gnus/BBDB/Org/Emacs/Linux


             reply	other threads:[~2020-03-19  6:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19  6:03 Bob Newell [this message]
2020-03-19  7:03 ` Eric Abrahamsen
2020-03-19 18:34 ` Bob Newell

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=871rpoubi8.fsf@emailmessageidheader.nil \
    --to=bobnewell@bobnewell.net \
    --cc=ding@gnus.org \
    /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).