Re: [exim] Subject from the .vacation.msg

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Matthew Soccio
Ημερομηνία:  
Προς: Exim-users
Αντικείμενο: Re: [exim] Subject from the .vacation.msg
I wanted to reply to my own question with the final answer that seems to
work. After a bit of testing and tweaking, here are the transport and
router that will allow users to have a Subject: line in their
.vacation.msg file. Thanks to Ian's suggestions, auto-replies from this
router should be rfc3834 and rfc2047 compliant.

vacation_router:
  driver = accept
  check_local_user
  user = ${lc:$local_part}
  domains = +local_domains
  require_files = ${home}/.vacation.msg
  address_data = ${readfile{${home}/.vacation.msg}}
  # See Exim autoreply wiki for list of senders that we don't auto-reply to.
  senders = !+noautoreply_senders
  # do not reply to errors or lists
  condition =  ${if or { \
     <snip> See 
http://wiki.exim.org/EximAutoReply?highlight=%28CategoryHowTo%29 for an 
example list
  no_expn
  transport = vacation_transport
  unseen
  no_verify


vacation_transport:
   driver = autoreply
   user = ${lc:$local_part}
   mode = 700
   log = ${home}/.vacation.log
   once = ${home}/.vacation.db
   once_repeat = 7d
   from = $local_part@$domain
   to = $sender_address
   subject = ${if match {$address_data}{\N(?i)^subject:\s+(\w+.*)\n(.*)\N}\
             {Auto: ${rfc2047:${escape:${length_60:$1}}}}\
             {Auto: Re: ${rfc2047:${escape:${length_60:$h_subject:}}}}}
   text = ${if match {$address_data}{\N(?i)^(subject:\s+\w+.*\n).*\N}\
          {${sg {$address_data}{$1}{}}}\
          {$address_data}}


In order for the senders = !+noautoreply_senders bit to work, I have
"addresslist noautoreply_senders = /etc/exim/autorep.noanswer" in the
main section of my config, and the autorep.noanswer file is populated
with the list mostly lifted from the autoreply wiki.

Matt