Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Politz <politza@fh-trier.de>
To: ding@gnus.org
Subject: Re: gnus imap vs exchange 2007
Date: Wed, 02 Sep 2009 20:15:46 +0200	[thread overview]
Message-ID: <874orli565.fsf@fh-trier.de> (raw)
In-Reply-To: <ytqp63c9abxz.fsf@ul000205.eu.tieto.com>

Lynbech Christian <christian.lynbech@tieto.com> writes:

> I use gnus to read my mail over imap. It works well to connect,
> authenticate and read mail but when the connection has been sitting idle
> for a while, something goes wrong when I try to reconnect, whether it is
> to read mail or just to enter a folder.

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.

After some digging, I wrote the following in my .emacs. It sends a NOOP
command every 3 minutes to every imap server, as specified by gnus
select methods. If the server is down, it attempts to reconnect.

The assumption here is, that the server enforces some kind of idle
timeout. Though I couldn't figure it out exactly.

(add-hook 'gnus-started-hook
          #'(lambda nil
              (gnus-demon-add-handler
               'nnimap-assert-connected 3 t)))

(defun nnimap-assert-connected ()
  (interactive)
  (let ((imap-ping-server t))           ;default is t anyway
    (dolist (server (cons gnus-select-method
                          gnus-secondary-select-methods))
      (when (and (eq 'nnimap (car server))
                 (not (gnus-server-opened server)))
        (gnus-remove-denial server)
        (gnus-close-server server)
        (and (gnus-open-server server)
             (message "Reconnected server %s"
                      (gnus-method-to-server server)))))))


-ap



  reply	other threads:[~2009-09-02 18:15 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 [this message]
2009-09-02 23:06   ` Dave Goldberg

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=874orli565.fsf@fh-trier.de \
    --to=politza@fh-trier.de \
    --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).