I'm trying to write fancy split that puts any message with "[foobar]" in the subject into a specific folder but nothing seems to work.

I have:

(setq nnimap-split-fancy '(|("subject" "\\[foobar\\]" "INBOX.foobar")

but it still ends up in the "default" mailbox.

If I change the regexp to just "foobar" it works (but then it matches other messages I don't want included). I think it's something to do with the escaping of the brackets. I've tried a couple of different of variations of escaping but there's something I'm missing. Or maybe I'm not fancy enough.

  • 1
    Did you set nnmail-split-methods to nnmail-split-fancy? Aug 6 '15 at 18:37
  • Tassilo Horn: Yep. It works if I do just "foobar" or "f.*bar". I just can't seem to escape the brackets properly.
    – seth
    Aug 7 '15 at 22:48
  • That's strange. Given that this is a regular expression, they are in fact quoted correctly... Aug 8 '15 at 6:57
  • Maybe gnus is doing something to the subject with the brackets at the beginning?
    – seth
    Aug 13 '15 at 19:09
  • I don't know. You could figure out which function evaluates the fancy splits and edebug it in order to see what's happening exactly. Aug 13 '15 at 19:15

Finally figured this out.

Had to use:

(setq nnimap-split-fancy '(|("subject" "\\[foobar]" "INBOX.foobar")
  • Please accept your own answer so that the robots don't keep placing this question periodically on the Active list.
    – lawlist
    Sep 18 '15 at 0:54

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.