[plug] Mail to generic aliases...

Brian Tombleson brian at paradigmit.com.au
Sat May 12 14:34:44 WST 2001


From: "Trevor Phillips" <phillips at central.murdoch.edu.au>
> Brian Tombleson wrote:
> >
> > Sendmail can also do this with the virtusertable.  Virtusertable handles
the
> > wildcard expansion and then setup aliases for your scripts.
> >
> > Email me if you're after specific implementation.
>
> Thanks all for the feedback. Seems qmail and exim have reasonably simple
> solutions. Dare I ask how complex it would be to do in Sendmail? ^_^
>
> I might do some tests with Exim, seeing that's what I have on my home box.
> Unfortunately, my usual host for mail lists does currently run Sendmail
> (it's an Ultra5/Solaris box), although I'm still toying with the idea of
> installing Debian on it.
-------------
Your original example was:
eg; A normal mail alias may be something like:
   fred:joebloggs at someother.place
A normal mail script may be something like:
   bingml:"|/my/mailist/script.pl"
Can I go:
   bing*:"|/my/mailist/script.pl"
... such that any e-mail sent to bing, bingbong, bingack, etc, all goes to
the
one script?
Or the ultimate catch-all:
   *:"|/my/catchall/script.pl"
Is this possible (be it through a specific agent, different syntax,
whatever)
short of writing your own entirely? ^_^

-------------
Assuming a couple of things inlcuding:
 Sendmail v. 8.10 or above
 You have persmisison from sendmail to run the script (see smrsh)
 You have configured sendmail to actually use the virtusertable (defualt for
RH RPM's).
     ie. you have a line in your m4 config file similar to:
          FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl

In /etc/mail/virtusertable add the line:
bing+*@yourdomain.com.au    bingml

In your /etc/mail/aliases file (or possibly /etc/aliases), add the line:
   bingml:"|/my/mailist/script.pl"
then run 'newaliases'

For your second example, all mail to one domain can be re-directed this way
by adding the following line to /etc/mail/virtusertable:
@yourdomain.com.au    bingmail

.. or rather, you'd probably make a sub domain 'bing' and have it like this:
@bing.yourdomain.com.au    bingml at yourdomain.com.au

NOTE: I have not actually tested the first solution (bing*), but that's what
the doco says (./sendmail-8.10.2/cf/README)

Hope this helps.
-Brian.




More information about the plug mailing list