[plug] Mail to generic aliases...

Jeremy Malcolm Jeremy at Malcolm.wattle.id.au
Thu May 10 20:20:40 WST 2001


Trevor Phillips wrote:
> 
> Does exim (or any other mail agent) support handling wildcard-based mail
> usernames by an arbitary script? Ok, I'm sure some do, it's just a case of ease
> of implementation.

Yes exim would do that.  Something along the lines of, in the transports
section of exim.conf:

bingaliases:
  driver = pipe
  user = username_with_exec_rights_to_your_perl_script
  command = "/path/to/your/perl/script ${local_part}"
  return_fail_output = true

then in the directors section of exim.conf:

bingmail:
  driver = smartuser
  prefix = bing
  transport = bingaliases

What that would do is look for any mail that is sent to an address
starting with "bing" and pipe it through your script.  Even easier, with
exim you can set up multiple .forward files depending on the part
following the prefix.  Thus "bingml" could be handled by .forwardml,
"bingack" could be handled by .forwardack.

You can also use exim's own filter syntax in lieu of procmail and a
.forward file, with something like this:

  if $local_part is "ml"
  then
    [action goes here]
  elif $local_part is "ack"
  then
    [action goes here]
  endif

Exim is really configurable and friendly, that's why I've mirrored the
documentation at http://exim.terminus.net.au.

Hope this helps.

-- 
Independent consulting solicitor* | _ .__ ._ _    |\/| _.| _ _ |._ _
and technology consultant.**    \_|(/_|(/_| | |\/ |  |(_||(_(_)|| | |
Personal site: http://malcolm.wattle.id.au     /   Finger for GPG key
* http://www.ilaw.com.au ** http://www.terminus.net.au jm at ilaw.com.au



More information about the plug mailing list