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?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Are you using
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
(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.