Gnus development mailing list
 help / color / mirror / Atom feed
* gnus imap vs exchange 2007
@ 2009-08-27  8:38 Lynbech Christian
  2009-09-02 18:15 ` Andreas Politz
  0 siblings, 1 reply; 3+ messages in thread
From: Lynbech Christian @ 2009-08-27  8:38 UTC (permalink / raw)
  To: ding

My company recently upgraded the mail server from exchange 2003 to
exchange 2007 and this is causing me some grief.

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 have tried both to turn on gnus imap debug and to trace the network
communications but I see nothing obvious in the traces. It is as if the
network connection just is terminated with no apparent error or message.

On eof the thing that has changed, I think, is that I am now using a
more sophisticated way of authenticating towards the server. I see
mentioning of `gssapi' (which fails) and `starttls' (which succeeds) in
the echo area.

I am running emacs 23 and a fairly recent gnus from CVS.

Does this ring a bell with anyone?


------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnus imap vs exchange 2007
  2009-08-27  8:38 gnus imap vs exchange 2007 Lynbech Christian
@ 2009-09-02 18:15 ` Andreas Politz
  2009-09-02 23:06   ` Dave Goldberg
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Politz @ 2009-09-02 18:15 UTC (permalink / raw)
  To: ding

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gnus imap vs exchange 2007
  2009-09-02 18:15 ` Andreas Politz
@ 2009-09-02 23:06   ` Dave Goldberg
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Goldberg @ 2009-09-02 23:06 UTC (permalink / raw)
  To: ding

> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-02 23:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-27  8:38 gnus imap vs exchange 2007 Lynbech Christian
2009-09-02 18:15 ` Andreas Politz
2009-09-02 23:06   ` Dave Goldberg

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).