1

I have a gmail account, and have set up gnus to read my email over IMAP. I'm also subscribed to a few mailing lists, and want them to be placed in individual directories, e.g. ml-openstack, ml-dpdk etc. so that when I open gnus, I have them not in INBOX, but in ml-openstack, ml-dpdk and so forth.

What should I tweak in emacs/gnus configuration to achieve this? Thanks.

Mark
  • 23
  • 3

1 Answers1

1

In Gnus it's called "splitting" the mail. It's covered in section 6.4.3 of the Gnus manual. (run M-: (info "(gnus)Splitting Mail") to jump right to it. Here's an example from the manual:

(setq nnmail-split-methods
  '(("mail.junk" "^From:.*Lars Ingebrigtsen")
    ("mail.crazy" "^Subject:.*die\\|^Organization:.*flabby")
    ("mail.other" "")))

You can see that it takes a list of folders to split into, and regexes to match against.

Since you're using IMAP, however, you want to set the variable nnimap-split-methods instead. It works the same way, but only applies to IMAP. See section 6.3.3 of the manual for more details.

Also, you might consider setting up filters in the Gmail UI instead, so that email is always sorted correctly even when you're not running Gnus.

db48x
  • 15,741
  • 1
  • 19
  • 23