I have the following in my ~/.gnus:
(gnus-demon-add-handler, 'gnus-demon-scan-mail 5 t)
(gnus-demon-init)
I expect that gnus will be checking for new emails every 5 min, however this doesn't happen. What am I doing wrong?
Are you using nnmaildir
or nnml
? It seems to me that the daemon does not work for nnmaildir
. Can someone confirm please.
Here is the code for gnus-demon-scan-mail
(defun gnus-demon-scan-mail ()
(save-window-excursion
(let ((servers gnus-opened-servers)
server
(nnmail-fetched-sources (list t)))
(while (setq server (car (pop servers)))
(and (gnus-check-backend-function 'request-scan (car server))
(or (gnus-server-opened server)
(gnus-open-server server))
(gnus-request-scan nil server))))))
Edit I have found these two functions on the gnus mailing list. They are really helpful to understand how things work.
;;; * check new mail
;;; ** function def
(defun gnus-demon-scan-mail-or-news-and-update (level)
"Scan for new mail, updating the *Group* buffer."
(let ((win (current-window-configuration)))
(unwind-protect
(save-window-excursion
(save-excursion
(when (gnus-alive-p)
(save-excursion
(set-buffer gnus-group-buffer)
(gnus-group-get-new-news level)))))
(message "scanning for new mail done")
(set-window-configuration win))))
(defun gnus-demon-scan-news-and-update ()
"Scan for new mail, updating the *Group* buffer."
(gnus-demon-scan-mail-or-news-and-update 3))
;;; ** command
(gnus-demon-add-handler 'gnus-demon-scan-news-and-update 10 nil)
(gnus-demon-add-handler 'gnus-demon-scan-mail 10 nil)
(gnus-demon-init)
And I'm using nnml
as my mail back-end with procmail
and fetchmail
(setq gnus-select-method '(nnml ""))
(setq mail-sources '((file :path "~/.mail/inbox.spool")
))
For mail notification you can use this https://stackoverflow.com/a/9611516/2081427 The you get notified in the mode-line each time a mail new mail comes.
Note I couldn't make gnus-notify.el
work for more than one group. So as far as I know
if you use nnmail-split-methods and want gnus-notify.el
for more than one group it won't work.
nnimap
backends as gnus-secondary-select-methods
with no gnus-select-metho
and gnus-demon-scan-mail
does not work OOTB for me. Instead, I rescan for mail with gnus-demon-scan-news
.
gnus-demon-scan-news
and gnus-demon-scan-mail
are built-in functions of gnus-demon.el
. Also the built-in gnus-notify.el
is a different package than the third-party gnus-desktop-notify.el
package which you linked.
gnus-notify.el
with the built-in gnus-notifications.el
, which you may be interested in.
comma
aftergnus-demon-add-handler
gnus-demon-scan-news
instead ofgnus-demon-scan-mail
? At first glance the latter does not seem to cover all backends, e.g. nnimap, which is what I use.