procmail
[Top] [All Lists]

Re: Recipe for sending to different users round-robin

1997-06-18 17:44:00
Roger Smith asked,

| I would like to get a procmail recipe to forward inbound e-mail to 2
| different moderators on a round-robin basis, or random basis.  What
| would be a good recipe to use?  I have looked at examples and others
| and cannot make head nor tail on how to alternate addresses like this.

OK, Roger, you did say "or random".  Here's a random way that should over
time send about half to each moderator:

    PID=$$

    :0
    * PID ?? [02468]^^
    ! moderator1
    :0E
    ! moderator2

Another way is to pull the seconds from the From_ line:

   :0
   * From .*:..:.[02468] ()
   ! moderator1
   :0E
   ! moderator2

but if you occasionally get malformed From_ lines with no proper time-
stamps, all those pieces will go to moderator2.

I see no way to guarantee alternation without use of an external file.