[exim] Exim 4.63 + MySql Vitual mailboxes + user filters?

Góra strony
Delete this message
Reply to this message
Autor: Robert Sigler
Data:  
Dla: exim-users
Temat: [exim] Exim 4.63 + MySql Vitual mailboxes + user filters?
Hello all,

I'm beginning to wonder if what I want to do is even possible, and if
not, is there an alternative...

I host several virtual domains and numerous mailboxes under each. All
are virtual and defined by a MySql database (no local users).
Ultimately, I would like to be able to move all mail which has a header
"X-Spam: Yes" to ..../Maildir/.Spam/cur (i use MailDirs). I've played
around with .forward files and exim filters, but exim insists on looking
up the user on the localsystem and then attempting to save the mail to a
file in the users home directory. For example, here's my forward file
/mailboxes/bluegoo/robert/.forward:

if
"$h_X-Spam:" is "Yes"
then
save /mailboxes/bluegoo/robert/Maildir/.Spam/cur/
endif

And in exim.conf, i have this config:

begin routers
userforward:
    driver = redirect
    check_local_user
    file = ${lookup mysql {MYSQL_Q_HOMEDIR}}/.forward
    user = mail
    group = mail
    allow_filter
    no_verify
    directory_transport = address_directory
    file_transport = address_file


begin transports
  address_directory:
    driver = appendfile
    maildir_format
    delivery_date_add
    envelope_to_add
    return_path_add


  address_file:
    driver = appendfile
    delivery_date_add
    envelope_to_add
    return_path_add



This mostly work, but when it comes down to the actual delivery attempt,
i get this in the mail log:
2006-12-14 12:48:34 1Guuh6-0001kT-K9 ==
/mailboxes/bluegoo.net/robert/Maildir/.spam/cur/ <robert@???>
R=userforward T=address_directory defer (13): Permission denied: failed
to chdir to /home/users/robert

Somehow exim determined that mail destined for robert@??? =
/home/users/robert (a valid local user)?
If i do the same thing for another user, which has no username in
/etc/passwd (foo@???, for example), the .forward is not
processed (as far as i can tell).

I think that's all the background and details... Hopefully someone has
had a similar situation, or can just tell me to give up. Either way,
i'd really appreciate any feedback!

~Robert