On Thu, May 03, 2001 at 12:10:52AM +0200, Fares Gianluca wrote:
>
>I would like to use a round robin distribution list.
>
>[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> should be forward all
>incoming messages to some people using this simple rule:
>the first message should be forwarded to [EMAIL PROTECTED]
><mailto:[EMAIL PROTECTED]> , the next one to [EMAIL PROTECTED]
><mailto:[EMAIL PROTECTED]> , the next to [EMAIL PROTECTED]
><mailto:[EMAIL PROTECTED]> the next to [EMAIL PROTECTED]
><mailto:[EMAIL PROTECTED]> and so on
>
>The server domain.com is running:
>qmail, vpopmail, ezmlm and ezmlm-idx
>
>I'm trying to use a simple script in .qmail-support that replace the
>forward instruction each time, but i think that it isnt a good solution.
Why? It's cool enough for three persons.
Otherwise:
echo "| roundrobin.pl supportpersonell.txt" > .qmail-support
and in supportpersonell.txt you have the email-addresses in order,
line by line, like this:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
etc.
It will be used and rotated by roundrobin.pl
roundrobin.pl:
===========================
#!/usr/bin/perl
# roundrobin.pl; (c) [EMAIL PROTECTED]; http://x42.com/; 2001-05-03
#
my $path = shift @ARGV;
my @addr;
open(FH, $path) or do { print "Couldn't get address."; exit(100); };
flock(FH, 2) or exit(111); # retry later
my $current = <FH>;
while (<FH>)
{
chomp;
s/^\s+//g;
s/\s+$//g;
if (length($_))
{
push @addr, $_;
}
}
open(FH, ">$path");
for (@addr)
{
print FH "$_\n";
}
print FH "$current\n";
close(FH);
qx(forward $current);
============================
/magnus
--
:..... Magnus Bodin
:::::::::::.. http://x42.com/
::::::::::::::::::.........................
oelntrisa=mpdhc.>;@gb:,10/)x(2y$fw<kq#3+v5z!?4