4

I use Mutt Maildir for storage mails. I created one mailbox like this Stack Exchange/. (whitespace between Stack and Exchange here)

procmailrc recipe:

:0
* From: .*Stack\ Exchange
Stack Exchange/

But upper recipe destination setting failed. after test and watch the log file. I found procmail jumped through Exchange/, deliver email to Stack file, instead of Stack maildir folder, nor Stack Exchange/ maildir folder.

And I googled procmail settings, FAQ etc. not found relative problems.

So, does anybody knows how to escape whitespace here ?

stardiviner
  • 191
  • 1
  • 3
  • 12
  • While it's perfectly valid to have spaces in file and directory names, doing so is likely to cause you all manner of unnecessary annoyances and problems. In other words: Patient: "Doctor, it hurts when I hit myself in the head with a hammer". Doctor: "Don't do that then". – cas Aug 28 '12 at 02:15
  • If you would ask "How can I escape whitespace here?", you would prevent people from correctly answer "Yes, someone knows." and also prevent errors ("anybody know" without "s", the space before the question mark). – Anthon Jul 01 '19 at 08:09

1 Answers1

3

Even though it isn't mentioned in the procmail manual, I believe (I haven't checked) that putting a backslash before the space removes its special meaning (like in other parts of procmail).

:0
* From: .*Stack\ Exchange
Stack\ Exchange/

If that doesn't work, use a variable.

STACKEXCHANGE_MAILBOX=Stack Exchange
:0
* From: .*Stack\ Exchange
$STACKEXCHANGE_MAILBOX
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • You're right, I forget put slash `/` after `Stack\ Exhcange/Android`, so that I can not use mutt to find mails in `Android`. It should be `Stack\ Exchange/Android/`, my fault. – stardiviner Jun 25 '12 at 04:12
  • You need to use the final slash if using Maildir and NOT to use it, if using Mbox. The backslash before space does escape the space as expected. – Jari Turkia Jun 04 '19 at 11:30