On Fri, Mar 17, 2006 at 03:01:40PM +1100, DOODS wrote:
> I just created a script for filtering emails for one domain. However, I
> don't know how to enable it and where to save that file. I'm running Exim
> with MySQL DB. I have been reading the manual and I can't see (at least
> just yet) the answers I am looking for.

In Exim, user filters are kind of intelligent forwards.  You need
a redirect router that processes the mail, and may generate new
addresses (or none, if the mail should be discarded).

You can store the script in your DB and use the "data" statement
of the redirect router with a MySQL lookup to retrieve it.  Don't
forget to set "allow_filter", and to define transports for files,
if the script should be able to file mails.

I use this at home:

localuser_verify:
  driver = accept
  domains = +userdomains   
  local_part_suffix = "-*"
  local_part_suffix_optional
  check_local_user
  require_files = $home/.forward
  verify_only = true

localuser_deliver:
  driver = redirect
  domains = +userdomains
  local_part_suffix = "-*"
  local_part_suffix_optional
  check_local_user
  require_files = $home/.forward
  file = $home/.forward
  check_ancestor
  allow_filter
  file_transport = localuser
  # no verify, because checks would be done with SMTP privileges
  verify = false

Instead of retrieving the filter by "data", Exim takes it from "file",
that's why I have two routers.  With filters in MySQL, you don't need
that.  In the above setup, not using a ".forward" file expresses the
desire not to get any mail.

Michael

-- 
## List details at http://www.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to