Gnus development mailing list
 help / color / mirror / Atom feed
From: Dave Goldberg <david.goldberg6@verizon.net>
To: ding@gnus.org
Subject: Re: gnus imap vs exchange 2007
Date: Wed, 02 Sep 2009 19:06:38 -0400	[thread overview]
Message-ID: <84my5daqv5.fsf@incoming.verizon.net> (raw)
In-Reply-To: <874orli565.fsf@fh-trier.de> (Andreas Politz's message of "Wed,	02 Sep 2009 20:15:46 +0200")

> I had a similar problem. Every once in while, when trying to update
> my imap group, gnus tells me that the connection is down and asks,
> if I want to go offline.

My situation is similar.  Two of my three nnimap servers at work,
which both happen to be exchange 2007, seem to time out, but in an
unclean way and gnus doesn't realize the server is closed until it's
trying to do something, resulting in an error.  This is a pain
particularly for gcc as the message would get sent and then be stuck
there on the error.  I would always have to go into the server buffer,
manually close and reopen the server, then go back to the message, M-x
undo (or equivalent) to get the Gcc line back, and rerun message-send,
answering no to the resend question and allowing Gcc to go.  I put
together the following hook to deal with that, and then extended the
concept to a hook for gnus-group-get-new-news.  The functions used
were determined by trial and error.  I am not certain they are the
right ones to use (they're really designed for interactive use) since
reading your code so I will be revisiting this at work sometime soon.
Thank you for that.

(defun dsg-gnus-reopen-server (SERVER)
  (interactive (list (completing-read "Server: " (mapcar 'list (mapcar 'gnus-method-to-server gnus-secondary-select-methods)))))
  (save-window-excursion
    (gnus-enter-server-buffer)
    (cond ((gnus-server-deny-server SERVER)
	   (gnus-server-open-server SERVER)
	   (gnus-server-close-server SERVER)
	   (gnus-server-open-server SERVER)))))

(add-hook 'message-send-hook
          (lambda ()
            (let ((GCC (message-fetch-field "Gcc")))
              (cond (GCC
                     (mapcar (lambda (SERVER)
                               (gnus-check-server
                                (gnus-server-to-method SERVER))
                               (if (not
                                    (gnus-check-server
                                     (gnus-server-to-method SERVER)))
                                   (dsg-gnus-reopen-server SERVER)))
                             (mapcar
                              '(lambda (FOO)
                                 (gnus-group-server FOO))
                              (split-string GCC ", *" t))))))))

(add-hook 'gnus-get-new-news-hook
          (lambda ()
            (mapcar (lambda (METHOD)
                      (gnus-check-server METHOD)
                      (if (not
                           (gnus-check-server METHOD))
                          (dsg-gnus-reopen-server
                           (gnus-method-to-server METHOD))))
                    gnus-secondary-select-methods)))

-- 
Dave Goldberg
david.goldberg6@verizon.net



      reply	other threads:[~2009-09-02 23:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27  8:38 Lynbech Christian
2009-09-02 18:15 ` Andreas Politz
2009-09-02 23:06   ` Dave Goldberg [this message]

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=84my5daqv5.fsf@incoming.verizon.net \
    --to=david.goldberg6@verizon.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).