[CentOS] Complex sendmail alias handling.

Rodrigo Barbosa rodrigob at darkover.org
Fri Mar 23 20:24:33 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Mar 23, 2007 at 10:49:47AM -0700, Hugh E Cruickshank wrote:
> Hi all:
> 
> I have a situation where I need to change the distribution of emails
> for selected accounts on a regular basis. This is for the controlling
> of the distribution of our "support" email address.
> 
> In the past I just created a "alias.bas" file to hold the bulk of our
> aliases and then 3 "support" alias files, alias.wkd, alias.evn and
> alias.wed (for weekday, evening and weekend day distribution lists) and
> then used crontab entries to cat the base file and one of the "support"
> files into the alias file and run newaliases.
> 
> This worked fine while everyone was working on an 0800-1600 schedule
> but now we have one person that will be working on an 0600-1800
> schedule a few days per week. This is going really muck up my simple
> little procedures.
> 
> I was wondering if anyone out there new of something short of an
> automatic email receiving and routing package (which I have not
> done any research on) that might fit my simple requirements.
> 
> Failing that can anyone recommend an automatic email receiving and
> routing package that is not to difficult to setup?

Humm, the "not too difficult to setup" is the hard part.

I would do this using Exim, maybe with MySQL and the backend,
and using "condition" based on the time to determine how to
route the message.

However, doing stuff like this on exim takes some learning. The
documentation is very complete but anything but intuitive (or even
light reading).

Maybe you can even do something "simpler", having multiple aliases
routers, using something like:

data = ${lookup{$local_part}lsearch{/etc/alias.0800-1600}}
condition = ${if and{{if >={${run{date "+%H"}{$value}}}{8}{1}{0}}{if <{${run{date "+%H"}{$value}}}{16}{1}{0}}}}

In this case, the router would only work between 08:00 and 15:59.
(NOTICE: This condition is untested, and probably contains syntax errors)

It would be easier using a database backend (mysql is my favorite), since
would could use the sql query for testing, instead of the "condition".

- -- 
Rodrigo Barbosa
"Quid quid Latine dictum sit, altum viditur"
"Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFGBDeBpdyWzQ5b5ckRAvjcAJsH4GLjyWLKQeT3qLKcifonOOeK7wCdEqs2
+BYf9XcLmQjqmFImx9lgOgI=
=8IxX
-----END PGP SIGNATURE-----



More information about the CentOS mailing list