Re: [Exim] trouble with autoreply for virtual domain users

Top Page
Delete this message
Reply to this message
Author: Avleen Vig
Date:  
To: Andrew Nelson
CC: exim-users
Subject: Re: [Exim] trouble with autoreply for virtual domain users
On Fri, Nov 07, 2003 at 06:06:03PM +1100, Andrew Nelson wrote:
> I'm sure it's simple but i'm new to exim and am a bit confused- can
> someone please help me write the router/transport?


Your timing couldn't be better. I jsut spent several days banging my
head over this one. The answer is pretty simple once you get it. VExim2
will use something like:

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


virtual_vacation_delivery:
  driver   = autoreply
  from     = "${local_part}@${domain}"
  to       = ${sender_address}
  subject  = "Autoreply from ${local_part}@${domain}"
  text     = ${lookup mysql{select vacation from users,domains \
                where domain='${quote_mysql:$domain}' \
                and localpart='${quote_mysql:$local_part}' \
                and users.domain_id=domains.domain_id}}



Important parts to note:
  Check for the Precedence header. You don't want to reply to mailing
    lists or bulk mail.
  Use 'unseen' so that the message is still delivered as-is to the
    recipient, while the reply to sent out. Adding an 'X-Autoreply-sent'
    header would be a nice touch if you wanted to.


Hope this helps!


--
Avleen Vig
Systems Administrator
Doing virtual domain hosting with Exim?
  Check out Virtual Exim: http://silverwraith.com/vexim
    (Click the banner, support development..)