Open sergiobortsov opened 8 years ago
I can give you an example of the exim4 config settings I use for this?
would be great)) s@neonet.ua please send me and thanks
hide mysql_servers = localhost(/var/lib/mysql/mysql.sock)/<database>/<user>/<password>
begin routers
userautoreply_sql:
driver = accept
domains = +local_domains
condition = ${if and{ \
{!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: } {OFF} } \
{ match {$h_Auto-Submitted: } {auto-generated} } \
{ match {$h_Auto-Submitted: } {auto-replied} } \
{ match {$h_X-Spam-Flag:} {\N^yes\N} } \
{ match {$h_X-Spam-Flag:} {\N^YES\N} } \
{ 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 } } \
}} \
{!eq{}{${lookup mysql {SELECT email FROM vacation WHERE active = 1 AND domain = '${quote_mysql:$domain}' AND local_part = '${quote_mysql:$local_part}' AND 86400*startdate < ${quote_mysql:$tod_epoch} AND 86400*enddate > ${quote_mysql:$tod_epoch}}}}} \
} \
{true}{false} }
transport = userautoreply_sql
senders = !+noautoreply_senders
unseen
begin transports
userautoreply_sql:
driver = autoreply
text = ${lookup mysql {SELECT message FROM vacation WHERE active = 1 AND domain = '${quote_mysql:$domain}' AND local_part = '${quote_mysql:$local_part}'} }
from = "${local_part}@${domain}"
no_return_message
subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {Autoreply Message}}"
to = "${sender_address}"
user = mail
headers = "X-Autoresponse: true"
once = /etc/virtual/${domain}/reply/sql_auto.once
once_file_size = 5K
once_repeat = 7d
thanks as far as I understand I should create additional table "vacation" to make it working? could please send dump of that table? because I have exim4u table users and on_vacation and vacation built-in fields so in exim.conf I have
virtual_vacation: driver = accept condition = ${if and { {!match {$h_precedence:}{(?i)junk|bulk|list}} \ {eq {${lookup mysql{select users.on_vacation from users,domains \ where localpart = '${quote_mysql:$local_part}' \ and domain = '${quote_mysql:$domain}' \ and users.on_vacation = '1' \ and users.domain_id=domains.domain_id}}}{1} }} {yes}{no} } no_verify no_expn unseen transport = virtual_vacation_delivery
On Fri, Jun 3, 2016 at 2:15 PM, wpoely86 notifications@github.com wrote:
hide mysql_servers = localhost(/var/lib/mysql/mysql.sock)/
/ / begin routers
userautoreply_sql: driver = accept domains = +local_domains condition = ${if and{ \ {!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_From:} {\N@lists.vvs.ac\N} } \ { match {$h_X-Auto-Response-Suppress: } {OFF} } \ { match {$h_Auto-Submitted: } {auto-generated} } \ { match {$h_Auto-Submitted: } {auto-replied} } \ { match {$h_X-Spam-Flag:} {\N^yes\N} } \ { match {$h_X-Spam-Flag:} {\N^YES\N} } \ { 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 } } \ }} \ {!eq{}{${lookup mysql {SELECT email FROM vacation WHERE active = 1 AND domain = '${quote_mysql:$domain}' AND local_part = '${quote_mysql:$local_part}' AND 86400_startdate < ${quote_mysql:$tod_epoch} AND 86400_enddate > ${quote_mysql:$tod_epoch}}}}} \ } \ {true}{false} } transport = userautoreply_sql senders = !+noautoreply_senders unseen
begin transports
userautoreply_sql: driver = autoreply text = ${lookup mysql {SELECT message FROM vacation WHERE active = 1 AND domain = '${quote_mysql:$domain}' AND local_part = '${quote_mysql:$local_part}'} } from = "${local_part}@${domain}" no_return_message subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {Autoreply Message}}" to = "${sender_address}" user = mail headers = "X-Autoresponse: true" once = /etc/virtual/${domain}/reply/sql_auto.once once_file_size = 5K once_repeat = 7d
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bhuisgen/rc-vacation/issues/36#issuecomment-223553453, or mute the thread https://github.com/notifications/unsubscribe/AF4i-2eerhidBqOEKNAYE6yETnhjADnrks5qIAztgaJpZM4IsnGX .
sergii bortsov 098 44 911 55 skype sergio.bortsov
The table I'm using is:
CREATE TABLE IF NOT EXISTS `vacation` (
`email` varchar(255) NOT NULL,
`local_part` varchar(255) NOT NULL,
`domain` varchar(255) NOT NULL,
`startdate` int(11) NOT NULL,
`enddate` int(11) NOT NULL,
`subject` varchar(255) NOT NULL,
`message` text NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`active` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
great! but it looks like you dont use exim4u (exim4u.org) gui for exim. I need integrate vacation table into current sql configuration. unfortunately, Im not so strong in this, so it will take some time. thank you very much for your help. have a nice weekend!
On Fri, Jun 3, 2016 at 2:27 PM, wpoely86 notifications@github.com wrote:
The table I'm using is:
CREATE TABLE IF NOT EXISTS
vacation
(local_part
varchar(255) NOT NULL,domain
varchar(255) NOT NULL,startdate
int(11) NOT NULL,enddate
int(11) NOT NULL,subject
varchar(255) NOT NULL,message
text NOT NULL,created
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',active
tinyint(4) NOT NULL DEFAULT '1' ) ENGINE=MyISAM DEFAULT CHARSET=utf8;— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bhuisgen/rc-vacation/issues/36#issuecomment-223555432, or mute the thread https://github.com/notifications/unsubscribe/AF4i-3r8uXmI2oVT3sSROM5HI-2AKrWVks5qIA-egaJpZM4IsnGX .
sergii bortsov 098 44 911 55 skype sergio.bortsov
Hello! Is it possible to change sql driver settings to connect to exim4u mysql database. Would be perfect to have some example or just direction for searching. thanks.