My specific use case concerns the "All Mail" folder exposed by Gmail over IMAP. I keep the folder permanently visible so I can search it when I need to, but I'm tired of pressing c (gnus-group-catchup-current) every time it gets new mail.

I looked for a relevant group parameter in the manual, but couldn't find it.

I can write an appropriate function and either add it to gnus-group-update-group-hook or set the gnus-group-update-group-function, but first I thought I'd ask.

Is there a more idiomatic way?

1 Answer 1


One approach could be to "read" the mail before it enters Gnus. Personally I use Mu4e and am interested in sorting mail, not marking it as read, but you could easily adapt the following to your needs.

The idea is to use a separate tool to make modifications on the server using the imap protocol. I am using imapfilter and have added the following to my init file:

(add-hook 'mu4e-update-pre-hook 'local/mu4e-run-imapfilter)
(defun local/mu4e-run-imapfilter ()
  (message "Running imapfilter...")
  (with-current-buffer (get-buffer-create " *imapfilter*")
    (goto-char (point-max))
    (insert "---\n")
    (call-process "imapfilter" nil (current-buffer) nil "-v"))
  (message "Running imapfilter...done"))

You'll have to add something similar to the appropriate Gnus hook and learn enough about imapfilter to hack an appropriate ~/.imapfilter/config.lua.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.