[Exim] vacation messages from mysql database

Top Page
Delete this message
Reply to this message
Author: Arturs Tiltins
Date:  
To: exim-users
Subject: [Exim] vacation messages from mysql database
Hello,

i'm now migrating mail server from sendmail/procmail to exim, and i want all
data like users, passwords, forward and autoreply data be stored in mysql
database. mean, no users home directories, .forward, .vacation or any else
data is found in filesystem, all is stored in mysql. with user mysql
authentication all seems to be ok, but there's problems with vacation
messages and forward.

with vacation i want to set up construction like this:

in section transports:

vacation_reply:
  driver = autoreply
  data = ${lookup mysql{SELECT message FROM autoreply \
    WHERE email='${local_part}@${domain}'}$value}fail}
# if nothing found, vacation message is not processed?
  log = ${lookup mysql{INSERT INTO autoreply_log (email, log) \
    VALUES ('${local_part}@${domain}', '${log} ${sender_address}'}}
# ${log} - is this correct? this can b
  once = ${lookup mysql{SELECT once FROM autoreply_db \
    WHERE email='${local_part}@${domain}'}$value}fail}
# i dont know structure of once; i need to update autoreply_db too, but how?
# ...


in section router:

user_vacation:
driver = accept
# ...
require = ${lookup mysql{SELECT message FROM autoreply WHERE
email='${local_part}@${domain}'}$value}fail}
# will this work?
transport = vacation_reply
# ...

and there's problem with forward:

userforward:
driver = redirect
check_local_user
data = ${lookup mysql{SELECT address from forward where
email='${local_part}@${domain}'}{$value}fail}
# ...

looking into logfile i see exim takes only first part of address, eg "user"
not "user@domain", so forwarding works incorrect. in mysql this query
returns correct "user@domain".

im using Exim version 4.20 #6, mysql Ver 11.18 Distrib 3.23.56, for
slackware-linux

any ideas with these problems?