Re: [exim] Total novice - autoreplies for aliases

Etusivu
Poista viesti
Vastaa
Lähettäjä: Troy Engel
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Total novice - autoreplies for aliases
Tony Finch wrote:
> On Tue, 23 May 2006, Patrick Unthank wrote:
>> What do I need to do in order to make an autoreply for a list of
>> addresses which are aliases. We are using ldap front end to maintain our
>> user list. There is an /etc/aliases file in existence but not all
>> aliases appear in there.
>
> You probably want to use an autoreply transport, as described at
> http://www.exim.org/exim-html-4.62/doc/html/spec_html/ch27.html
> and I expect you'd want an accept router for the relevant addresses
> which passes them to your autoreply transport.


Philip help me craft this awhile back (different purpose, same result).
What you want is a system wide filter to trap the alias(es) in question
and send the generic response.

You'll need to enhance this to use; but, no matter where your aliases
are (LDAP or File) if you route them to this special user ('mary'
example) then it should generically work.

1) route all desired aliases to a named item. For example:

fred: mary
john: mary

2) set up a router to trap 'mary', trigger a filter and send a reply.
It's wise to put this first in exim.conf, before system_aliases and the
like, to prevent weird loops and stuff:

   mary_router:
     driver = redirect
     local_parts = mary
     allow_filter
     file = /etc/mail/maryfilter.txt
     reply_transport = address_reply
     user = mail


3) craft the 'mary' filter, /etc/mail/maryfilter.txt, which will send
back the contents of /etc/mail/maryreply.txt:

   # Exim filter
   if error_message then finish endif
   mail
    subject "Hi from Staff: $h_to:"
    from "do-not-reply@${qualify_domain}"
    reply_to "do-not-reply@${qualify_domain}"
    expand file "/etc/mail/maryreply.txt"
   seen finish


4) create the response text /etc/mail/maryreply.txt:

Greetings,

Mary loves you. And your cat.

Love,
The Staff


Note that the 'seen finish' in the filter blackholes (throws away) all
emails; if you want, add some 'deliver' commands to send a copy off to
other people behind the scenes first.

HTH,
-te

--
Troy Engel | Systems Engineer
Fluid, Inc | http://www.fluid.com