1

Hope to try to filter some mail from "foo@example.com" and the subject contains "sw-report".

I tried to put this configure to my init.el:

   (setq nnmail-split-methods 'nnmail-split-fancy
         nnmail-split-fancy
         '(any "sw-report"
               (from "foo@example.com" "nnmaildir+COMPANY:INBOX.SWREPORT")))

But it doesn't work. Nothing is filtered.

My inbox is locate at nnmaildir+COMPANY:INBOX.

1

nnimap-split-fancy is actually a server variable rather than a global variable, so the right place to set it is as part of gnus-secondary-select-methods. So something like this:

(setq gnus-secondary-select-methods
      '((nnimap
        "Work"
        (nnimap-user "bob@example.com")
        ;; Other server vars
        (nnimap-split-fancy
         (| (any "sw-report"
                 (from "foo@example.com" "INBOX.SWREPORT"))
            ;; other rules
            )))))

(This is untested, and I always have trouble with splitting syntax, so it will probably require tweaking before it works.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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