Re: [Exim] Flexible autoresponder in system filter

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Greg Ward
Dátum:  
Címzett: exim-users
Tárgy: Re: [Exim] Flexible autoresponder in system filter
On 13 November 2001, I said:
> Hmmm, that sounds like wise advice. Would solve the whole "multiple
> recipients" problem at a stroke. Only hitch is that the addresses
> involved don't really have local accounts. Guess I could cook something
> up, but it seems more sensible to do central, per-address filtering as
> in section 47.3 of the spec. I'll play around with that.


Yes indeed, this worked like a charm. For the benefit of posterity,
here's what I did:

  * added a central_filter director as in section 47.3 of the spec,
    "Per-address filtering".  Here's my director:


      central_filter: 
        driver = forwardfile 
        file_transport = address_file 
        pipe_transport = address_pipe 
        reply_transport = address_reply 
        file = /etc/exim/filters/$local_part 
        user = mail 
        no_check_local_user 
        filter 
        allow_system_actions 


    Note that I dropped the "no_verify" option.  The effect of
    "no_verify", as near as I could tell, is to make it so messages
    to localparts in /etc/exim/filters can only be delivered by
    a local exim process, and not via a remote SMTP client.
    This is Exim 3.12 (Debian potato), so that may have been fixed
    in more recent versions of Exim.


  * added a filter for the "webmaster" localpart (which handles
    both local domains, since we don't really distinguish between
    our two domains) in the file /etc/exim/filters/webmaster:


      # exim filter 
      # This is the auto-responder for webmaster email; it is very important 
      # to use "to $sender_address" here, so we don't send auto-responses to 
      # bounce messages! 
      if not ($sender_address_domain is "mems-exchange.org" or 
              $sender_address_domain is "memsnet.org") then 
        mail to $sender_address 
             from $local_part@$domain 
             subject "Re: $header_subject" 
             expand file /etc/exim/webmaster_reply.txt 
      endif 


      deliver gward 
      deliver other_webmaster
      deliver another_webmaster


    (Since we use our webmaster address as the SMTP sender for lots
    of automated mail sent out by our web site, it's particularly
    important to use $sender_address, not the default $reply_address.
    If I hadn't done this, then if some user enters a bogus email
    address when registering with our site, then this might happen:
      webmaster@??? -> bogus@???   (for various reasons)
      postmaster@??? -> webmaster@???  (bounce message)
      <>@mems-exchange.org -> mailer-daemon@???      (auto-response)


    That would be stupid and bothersome to the admin of dom.ain, so I
    want to avoid it.  Not sure what would happen if dom.ain doesn't
    exist at all, but I'm sure it wouldn't be pretty.


* wrote the auto-response file, /etc/exim/webmaster_reply.txt:

      Thank you for your message to $local_part@$domain. 


      This is an automated response; while we do read all e-mail sent  
      to this address, we do not necessarily respond to every message. 


      [...]


    (The rest is mainly to tell people 1) this is not how to get
    a job, and 2) we're not here to do your homework.  Sheesh!)


Exim is cool. Now, what *else* can I add to /etc/exim/filters...

        Greg
-- 
Greg Ward - software developer                gward@???
MEMS Exchange                            http://www.mems-exchange.org