RE: [Exim] vacation messages from mysql database

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Troy Settle
Date:  
À: 'Arturs Tiltins', exim-users
Sujet: RE: [Exim] vacation messages from mysql database
Here's what works for me:

MYSQL_AUTOREPLY    = SELECT CONCAT('#Exim filter\nif personal\nthen\n
mail\n\tto \$reply_address\n\tfrom ', users.username, '\n\tsubject
"Autoreply (\$h_subject:)"\n\ttext
"',REPLACE(users.replymsg,'\\n','\\\\n'),'"\n\tonce
/var/spool/exim/autoreply/${local_part}@${domain}\n\tonce_repeat
',repeat,'\nendif') FROM users WHERE users.autoreply=1 AND
SUBSTRING_INDEX(users.username,'@',-1) = '${quote_mysql:${domain}}' AND
SUBSTRING_INDEX(users.username,'@',1) = '${quote_mysql:${local_part}}'


autoreply:
    driver                = redirect
    allow_filter
    allow_defer
    allow_fail
    check_local_user        = false
    data                = ${lookup mysql{MYSQL_AUTOREPLY}}
    no_verify
    no_expn
    check_ancestor
    reply_transport            = address_reply
    user                = mailnull



--
Troy Settle
Pulaski Networks
http://www.psknet.com
540.994.4254 ~ 866.477.5638
Pulaski Chamber 2002 Small Business Of The Year


> -----Original Message-----
> From: exim-users-admin@???
> [mailto:exim-users-admin@exim.org] On Behalf Of Arturs Tiltins
> Sent: Tuesday, July 22, 2003 5:58 AM
> 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?
>
>
>
>
>
> --
>
> ## List details at
> http://www.exim.org/mailman/listinfo/exim-users Exim details
> at http://www.exim.org/ ##
>
>