MailPlex ~~~~~~~~ v1.1 (l) Peter Baudis LGPL'ed software What does this software? ~~~~~~~~~~~~~~~~~~~~~~~~ It works as a 'mail multiplexer' - it watches mailbox of the account under which it was launched, and mailboxes of defined targets. Then, when mail comes to its mailbox, it sends it to the target which is longest w/o any message. So you can effectively use it for some service which is operated by multiple operators with one mailbox, assuring the work is effectively divided. Note that operators have to be local users in normal situation, unless some non-standart isfree.pl module is used. Example situation: you have user help at machine 911.gov, which is watched by MailPlex, and local users alice and bob, which are operators. So, when first mail will come at help@911.gov, alice will receive it, next mail will receive bob. Now both alice and bob have waiting mails, so when next three mails will come, they are just queued, and MailPlex is waiting... Suddenly bob will get mail from his mailbox, so it will become empty, so MailPlex will send him next mail. Now, both bob and alice at once will empty their mailbox, so, because alice is first in @rcpts list, she will get first mail and bob will get second. Now the queue is empty and operators are busy. Now first bob and then alice will empty their mailbox, so next mail will come to bob, and even if bob will handle it before alice will get her one, next mail will belong to her and then next one to bob once more. Clear? ;-) How to use it? ~~~~~~~~~~~~~~ First, you will need MailTools installed. Testion 1.15 is tested to work, earlier may not. You can get MailTools e.g. from CPAN, then untargz it, make, test and install then :-). Now, you should be ready for the main work. This set consists from four scripts by default. First, main, multi.pl, is doing the main job - it runs as a daemon, periodically checking mailbox for the user which called him, and calling other script to get state of each target. It manages the queue of them and if a mail comes, it sends it to the first target in queue, calling another two scripts to do so. multi.pl - main program isfree.pl - checking state of targets mailget.pl - managing main mailbox resend.pl - re-sending mail to a target You should be interested in executing only the first one, but you should have a look to the start of each one, for checking the configuration section. Anyway main configuration stuff in is the header of multi.pl. After everything is in the place, try to call the script, breathing deeply. For the first time, it can be good to set $debug to 1 in multi.pl, to see what's going on. DO NOT RUN IT UNDER YOUR NORMAL ACCOUNT, or you will find your mails around all the system then ;-). You should probably make special account for the MailPlex, or, if you have qmail, try to do some magic with qmail's .qmail- files and hard-set $mbox= variables. You can also combine it with procmail etc, no limits to your fantasy :-). Now try to send some mails to the account, more than number of targets you defined. Then empty some targets and check if the rest of mails came there. Everything should work properly, if it doesn't, check the configuration, and if it still doesn't, do it once more. Still nothing ...? See next section then. Problems? ~~~~~~~~~ This software wasn't really extensively tested under heavy load, but it should work fine anyway. You can write own modules (even in other language than perl, no prob with it, just abide the specification in header of each original module :-) to improve some performance or fix possible sharing conflicts (e.g. rewrite mailget.pl to use POP3 interface? hint: use Net::POP3 from libnet ;-). It should be pretty easy. If you will make them, please let me know. This software was actually tested only under postfix, but it should run under any other mailer as well, as long as it is using normal mailbox format. Otherwise, e.g. if you are using qmail's maildir format, it looks you are out of luck, unless you will write different mailget.pl to handle it. Feel free to ask me at . Patches && improvations && ideas are welcomed. Actual version of this software can be obtained from http://pasky.ji.cz/~mplex/. If you will be dropping me a bug report, please include version of MailPlex, OS and MTA you are using, and the scripts themselves probably, so i will be able to check the configuration by myself. PLEASE tell me, if you will use this software or clone it or just take idea from it, because i really wonder if anyone can be interested in it :-).