Re: [Exim] directory_transport in virtualuserforward

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Nico Erfurth
Data:  
Para: tilo.buschmann, exim-users
Assunto: Re: [Exim] directory_transport in virtualuserforward
tilo.buschmann@??? wrote:
> Hi
>
> I am the one with this terrible virtual user config :-)
>
> To summarize:
>
> Emails go to
>
> /var/spool/virtual/mail/$userid/
>
> in Maildir-format
>
> Everything works really well (hey, I like to have everything in the mysql-server,
> and it does what I want).
>
> Currently I am working to support "save" in forward files to save to a
> special maildir.
>
> All forward files are now in
>
> /var/spool/virtual/forward/$userid.forward
>
> but only for debugging purposes, it will move later to the data field in
> my exim.conf.
>
> When I have a directive like
>
> |if $h_subject: contains "EMAILTEST2"
> |then
> |        save .test/
> |endif

>
> exim saves this file to /var/spool/virtual/forward/.test/ but of course I want
> exim to save this email to
>
> /var/spool/virtual/mail/$userid/.test/
>
> My Forward directive looks the following way:
>
> virtualuserforward:
> driver = forwardfile
> domains = QUALY_DOMAIN
> local_parts = mysql;MYSQL_USER
> pipe_transport = virtual_address_pipe
> directory_transport = virtual_address_directory
> reply_transport = address_reply
> no_verify
> file_directory = /var/spool/virtual/forward
> file = ${lookup mysql {USER_TO_USERID}{$value}{${local_part}}}.forward


this is a bug(?) in exim (i suppose you use exim3?)
file_directory = /var/spool/virtual/mail/${lookup mysql \
                  {USER_TO_USERID}{$value}{${local_part}}}
file = /var/spool/virtual/forward/${lookup mysql \
                  {USER_TO_USERID}{$value}{${local_part}}}.forward



the problem is, exim prepends the users homedir to relative pathes when
the save-command is used, but in your config is no real homedir/user,
BUT file_directory overrides this, and sets a homedir. This trick only
works with exim3, in exim4 you need some black magic to use relative
pathes in a virtualuser-enviroment.


ciao