Mailing List Archive

Subject: in autoreply (vacation)
Hi All,

I've just configured vacation service using autoreply transport. It looks
like this:


vacation_pipe:
driver = autoreply
file = /home/${local_part}/.vacation
to = ${sender_address}
from = ${original_local_part}@${original_domain}
subject = "Autoreply: Vacation message for ${local_part}@${domain}"
log = /home/${local_part}/.vacation_log
once = /home/${local_part}/.vacation_log_db


and in the DIRECTORS:


on_holiday:
driver = localuser
transport = vacation_pipe
require_files = ${local_part}:/home/${local_part}/.vacation
unseen


Everything works fine.
The only thing I need to do is a user could change its Subject header value.

Now it is always "Autoreply: Vacation message for ${local_part}@${domain}"
but I want to read the content of Subject header from a file, for example
from /home/${local_part}/.subject.

I know that the subject can be read from MySQL database, but I don't want
to involve MySQL.

How to make exim to read Subject value from a file?

Robert
Re: Subject: in autoreply (vacation) [ In reply to ]
Hallo Robert Heron,

In message "[Exim] Subject: in autoreply (vacation)"
on 22.05.2002, Robert Heron <robert@heron.pl> writes:

RH> Hi All,

RH> I've just configured vacation service using autoreply transport. It looks
RH> like this:

What do you think about this?

CREATE TABLE autoresponder (
arp_aid int(11) NOT NULL auto_increment,
arp_usr_aid int(11) NOT NULL default '0', --- user aid
arp_subject varchar(255) NOT NULL default '',
arp_text text NOT NULL,
arp_from date NOT NULL default '0000-00-00',
arp_till date NOT NULL default '0000-00-00',
arp_status smallint(6) NOT NULL default '0',
PRIMARY KEY (arp_aid)
) TYPE=MyISAM;


MYSQL_AUTORESP_SUB = \
Select arp_subject \
from autoresponder, user, domain, site \
where \
dom_name = '${quote_mysql:$domain}' and \
dom_sit_aid = sit_aid and \
sit_aid = usr_sit_aid and \
usr_uname = '${quote_mysql:$local_part}' and \
arp_usr_aid = usr_aid

MYSQL_AUTORESP_BODY = \
Select arp_text \
from autoresponder, user, domain, site \
where \
dom_name = '${quote_mysql:$domain}' and \
dom_sit_aid = sit_aid and \
sit_aid = usr_sit_aid and \
usr_uname = '${quote_mysql:$local_part}' and \
arp_usr_aid = usr_aid


=== DIRECTORY ===

mysql_autoresponder:
driver = accept
condition = \
${if or \
{ \
{ match { $h_precedence: } { (?i)junk|bulk|list } } \
{ eq \
{ \
${lookup \
mysql{ MYSQL_AUTORESP_CHK } \
{1} \
} \
}{1} \
} \
} {no} {yes} \
}

transport = mysql_autoresponder_delivery
errors_to = postmaster@$domain
unseen
no_verify
no_expn

=== TRANSPORT ===

mysql_autoresponder_delivery:
driver = autoreply
log = /var/mail/${domain}/${local_part}_vac_log
once = /var/mail/${domain}/${local_part}_vac_once_db
return_path = ${local_part}@${domain}
to = ${sender_address}
from = ${local_part}@${domain}
subject = ${lookup mysql{MYSQL_AUTORESP_SUB}}
text = ${lookup mysql{MYSQL_AUTORESP_BODY}}



--
Mit freundlichen Gruessen,
Wild Karl-Heinz
mailto:kh.wild@wicom.li
Re: Subject: in autoreply (vacation) [ In reply to ]
Here's what I did for our users (3.36) (I know some of this isn't great,
I'm just presenting the concept). It looks up the interesting stuff from a
user's .vacation file, or uses defaults if needed. This is designed to
be run from a web interface, though I haven't built that part yet. I
recently expanded the condition to allow a simulation of vacation's -a
option. The only thing that's really missing is a lookup for once_repeat,
but that string isn't expanded. I put in a feature request for it a while
back. .vacation looks like this:

FROM: John Jetmore <jetmore@cinergycom.com>
USERS: (?i)john@|jetmore
SUBJECT: Re: $h_subject:
TEXT: This is\nthe body\nof the\nresponse

DIRECTOR:
local_vacation:
driver = localuser
transport = local_vacation
require_files = /home/${lc:$local_part}/.vacation
condition = \
${if match\
{$h_to:}\
{\
${lookup{USERS}lsearch{\
/home/${lc:$local_part}/.vacation\
}{$value}{(?i)$local_part}}\
}\
{yes}\
{no}\
}
no_verify
no_expn
unseen

TRANSPORT:
local_vacation:
driver = autoreply
user = $local_part
to = $sender_address
once_repeat = 7d
once = /home/${lc:$local_part}/.vacation.db
from = \
${lookup{FROM}lsearch{\
/home/${lc:$local_part}/.vacation\
}{$value}{$local_part@$domain}}
subject = \
${expand:\
${lookup{SUBJECT}lsearch{\
/home/${lc:$local_part}/.vacation\
}{$value}{Away from mail}}\
}
text = \
${expand:\
${lookup{TEXT}lsearch{\
/home/${lc:$local_part}/.vacation\
}{$value}{I am currently away from my mail}}\
}


On Wed, 22 May 2002, Robert Heron wrote:

> Hi All,
>
> I've just configured vacation service using autoreply transport. It looks
> like this:
>
>
> vacation_pipe:
> driver = autoreply
> file = /home/${local_part}/.vacation
> to = ${sender_address}
> from = ${original_local_part}@${original_domain}
> subject = "Autoreply: Vacation message for ${local_part}@${domain}"
> log = /home/${local_part}/.vacation_log
> once = /home/${local_part}/.vacation_log_db
>
>
> and in the DIRECTORS:
>
>
> on_holiday:
> driver = localuser
> transport = vacation_pipe
> require_files = ${local_part}:/home/${local_part}/.vacation
> unseen
>
>
> Everything works fine.
> The only thing I need to do is a user could change its Subject header value.
>
> Now it is always "Autoreply: Vacation message for ${local_part}@${domain}"
> but I want to read the content of Subject header from a file, for example
> from /home/${local_part}/.subject.
>
> I know that the subject can be read from MySQL database, but I don't want
> to involve MySQL.
>
> How to make exim to read Subject value from a file?
>
> Robert
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>
>
Re: Subject: in autoreply (vacation) [ In reply to ]
On Wed, 22 May 2002, Robert Heron wrote:

> Now it is always "Autoreply: Vacation message for ${local_part}@${domain}"
> but I want to read the content of Subject header from a file, for example
> from /home/${local_part}/.subject.

In Exim 4 this is easy because there's a "read file" item you can stick
in an expansion string. I'm afraid that in Exim 3 this isn't easy.

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.