[Exim] directory_transport in virtualuserforward

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: tilo.buschmann
Fecha:  
A: exim-users
Asunto: [Exim] directory_transport in virtualuserforward
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
check_ancestor
owners = mail
modemask = 002
filter

and my virtual_address_directory:

virtual_address_directory:
  current_directory = ${perl{foo}{${lookup \
       mysql {USER_TO_USERID}{$value}{${local_part}}}}{$message_id}}
  driver = appendfile
  no_from_hack
  maildir_format
  user = mail
  group = mail
  mode = 0660
  directory_mode = 0770
  create_directory = true
  mode_fail_narrower = false
  quota = ${lookup mysql {select CONCAT(equota,'M')\
          from user where user = '${quote_mysql:$local_part}'}{$value}}
  maildir_tag = "$message_id:2,"
  check_string = ""
  escape_string = ""
  prefix = ""
  suffix = ""
  envelope_to_add
  return_path_add
  delivery_date_add


this perl function gives back:

/var/spool/virtual/mail/$userid/.test/

(This perl script does a lot of more than only creating this string,I
use it to have it everytime executed)

I tried to use "current_directory" _and_ "directory" but it delivers everytime
to /var/spool/virtual/forward/.test/ and it does _not_ execute the perl script
(so I think it ignores this option)

Is it possible to let exim deliver this email to the place I want and execute
this scipt?

Tilo