[Exim] Maildir to subfolders

Inizio della pagina
Delete this message
Reply to this message
Autore: Derek Broughton
Data:  
To: exim-users
Oggetto: [Exim] Maildir to subfolders
I've been playing with an attempt to direct mail to a Maildir subfolder
if it has a subject containing "\[\w+\]".

The director is:
<director>
# First attempt to deliver direct to subfolders

localfolder:
driver = localuser
transport = folder_delivery
require_files = "/home/$local_part/Maildir/${if match \
{$header_subject:}{\\[(\\w+)\\]} {.$1/} {XXtest} }"


# This director matches local user mailboxes.

localuser:
driver = localuser
transport = local_delivery
</director>

if I pass the following line to exim -be, it works:
${if match {"line [test] x"} {\\[(\\w+)\\]}{$1}{no}}

returning "test" as expected. If I replace the require_files line above
with:
require_files = "/home/$local_part/Maildir/$header_subject:"

then the folder_delivery transport is invoked iff the entire subject
matches a file beneath Maildir (which wouldn't be a valid folder name -
at least with courier-imap's use of Maildir, but that's not the
problem...). So the actual subject is definitely there in
$header_subject:, and -be implies that it should be handled correctly,
but nothing ever matches!

Note, that if I leave the 'else' condition off the if, allowing it to
return a null string, folder_delivery gets invoked for everything, since
every user does have a ~/Maildir.

It's gotta be something stupid I'm doing with the regex but I can't
figure it out (single escaping the square brackets for -be causes it to
treated as a character class delimiter as expected [determined by only
giving it one])
--
derek