Re: [exim] autoreply sql from date to date

Top Page
Delete this message
Reply to this message
Author: Torsten Müller
Date:  
To: exim-users
Subject: Re: [exim] autoreply sql from date to date
Hello,
i do it this way.

Greetings Torsten

Am 24.01.2023 um 12:38 schrieb Sławomir Dworaczek via Exim-users:
> hi
> Do you have any idea how to set the auto-response parameter to work from date to date in exim using SQL query
> Regards
>



--- router ----
uservacation:
     driver = accept
     domains = ${lookup mysql { \
         SELECT domain FROM mail \
         WHERE username='${quote_mysql:$local_part}' \
         AND punycode='${quote_mysql:$domain}' \
         AND uservacactive=1 \
         AND UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(uservacvon) \
         AND UNIX_TIMESTAMP(NOW()) < UNIX_TIMESTAMP(uservacbis) \
         }{$value}}
     condition = ${if or { \
     { match {$h_precedence:} {(?i)junk|bulk|list} } \
     { eq {$sender_address} {} } \
     { def:header_X-Cron-Env: } \
     { def:header_Auto-Submitted: } \
     { def:header_List-Id: } \
     { def:header_List-Help: } \
     { def:header_List-Unsubscribe:} \
     { def:header_List-Subscribe: } \
     { def:header_List-Owner: } \
     { def:header_List-Post: } \
     { def:header_List-Archive: } \
     { def:header_Autorespond: } \
     { def:header_X-Autoresponse: } \
     { def:header_X-Autoreply-From: } \
     { def:header_X-eBay-MailTracker: } \
     { def:header_X-MaxCode-Template: } \
     { match {$h_X-Auto-Response-Suppress: } {OOF} } \
     { match {$h_X-OS:} {HP Onboard Administrator} } \
     { match {$h_X-MimeOLE:} {\N^Produced By phpBB2$\N} } \
     { match {$h_Subject:} {\N^Yahoo! Auto Response$\N} } \
     { match {$h_Subject:} {\N^ezmlm warning$\N} } \
     { match {$h_X-FC-MachineGenerated:} {true} } \
     { match {$message_body} {\N^Your \"cron\" job on\N} } \
     { match {$h_Subject:} {\N^Out of Office\N} } \
     { match {$h_Subject:} {\N^Auto-Reply:\N} } \
     { match {$h_Subject:} {\N^Autoresponse:\N} } \
     { match {$h_Subject:} {\N(Auto Reply)$\N} } \
     { match {$h_Subject:} {\N(Out of Office)$\N} } \
     { match {$h_Subject:} {\Nis out of the office.$\N} } \
     { match {$h_From:} {\N(via the vacation program)\N } } \
     { match {$h_X-Spam-Flag:} {\N^yes\N} } \
     } \
     } {no} {yes} \
     }
     transport = vacation_transport
     unseen
     no_expn
     no_verify


--- transport ---
vacation_transport:
     driver = autoreply
     once_repeat = 7d
     once_file_size = 5M
     once = ${lookup mysql {select concat('/var/spool/exim/vacation/', 
punycode, '@', username, uservacadded , '@once') from mail WHERE 
username='${quote_mysql:$local_part}' AND 
punycode='${quote_mysql:$domain}'}{$value}}
     log = ${lookup mysql {select concat('/var/spool/exim/vacation/', 
punycode, '@', username, uservacadded , '@log') from mail WHERE 
username='${quote_mysql:$local_part}' AND 
punycode='${quote_mysql:$domain}'}{$value}}
     to = "${if def:h_Errors-To: {$h_Errors-To:} {$sender_address}}"
     from = ${local_part}@${domain}
     subject = "Re: ${rfc2047:$h_Subject:}"
     text = ${lookup mysql { \
         SELECT uservactext FROM mail \
         WHERE username='${quote_mysql:$local_part}' \
         AND punycode='${quote_mysql:$domain}' \
         }{$value} fail }
     user = exim