Here's a further revision which fixes the $home and relative path problem.
Box after "DIRECTORS CONFIGURATION"
Code:
virtual_userforward:
#!!# filter renamed allow_filter
driver = redirect
allow_filter
check_ancestor
user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
group = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
domains = lsearch;/etc/userdomains
no_expn
file = "${extract{5}{:}{${lookup{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}lsearch{/etc/passwd}{$value}}}}/.forward.${local_part}"
file_transport = virtual_address_file
pipe_transport = virtual_address_pipe
reply_transport = address_reply
no_verify
Box right before "RETRY CONFIGURATION"
Code:
virtual_address_file:
driver = appendfile
delivery_date_add
envelope_to_add
file = "${extract{5}{:}{${lookup{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}lsearch{/etc/passwd}{$value}}}}/mail/${domain}/${local_part}/$address_file"
group = mail
mode = 0660
quota = "${if exists{${extract{5}{:}{${lookup{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}lsearch{/etc/passwd}{$value}}}}/etc/${domain}/quota} {${lookup{$local_part}lsearch*{${extract{5}{:}{${lookup{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}lsearch{/etc/passwd}{$value}}}}/etc/${domain}/quota}{$value}}} {}}"
return_path_add
user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
Make sure you un-wrap any lines from your cut-n-paste here.
I'll continue testing and let you know if I revise further...
[edit]
Note that this skips all spam checking. That's my next problem to tackle ....
[/edit]