Procmail recipe - spaces in Maildir stops it working

Procmail recipe - spaces in Maildir stops it working

am 30.05.2007 19:18:25 von david

Hi,

I've Googled without success and wonder if anyone else can help.

I have added a simple test to my .procmailrc to "file" certain messages
into a subdirectory on my IMAP server. However, the subdirectory
contains spaces in the directory name and this seems to be causing
procmail to fail and I can't find out how I should indicate a space.

The bit of my .procmailrc that is causing the problem is;

jpm_bookings_folder="$HOME/Maildir/.J P Morgan.Booking Confirmations/"

:0
* ^Subject\: JPMorgan Booking
$jpm_bookings_folder


and in my procmail.log I see that it successfully matches on the test
but the next lines in the log are

"procmail: Skipped "P Morgan.Booking Confirmations/"
"procmail: Assigning "LASTFOLDER=/home/david/Maildir/.J"

So obviously assign the variable jpm_bookings_folder works fine but then
it can't seem to handle the space when it tries to move it to the actual
subdirectory I want.

Can anyone tell me a way to correct my recipe please.

Thanks!

David.

Re: Procmail recipe - spaces in Maildir stops it working

am 30.05.2007 23:36:32 von Alan Clifford

On Wed, 30 May 2007, David wrote:



D> and in my procmail.log I see that it successfully matches on the test but the
D> next lines in the log are
D>
D> "procmail: Skipped "P Morgan.Booking Confirmations/"
D> "procmail: Assigning "LASTFOLDER=/home/david/Maildir/.J"
D>

I'd try escaped spaces in the variable assignment. The \ should keep its
literal value in the assignment but act as an escape in the action line.

jpm_bookings_folder="$HOME/Maildir/.J\ P\ Morgan.Booking\ Confirmations/"


Other thoughts:

"$jpm_bookings_folder"

as the action line.

or

${jpm_bookings_folder}

as the action line


--
Alan

( If replying by mail, please note that all "sardines" are canned.
However, unless this a very old message, a "tuna" will swim right
through. )