I'm working on some enhancements to MailServ
(http://iquest.com/~fitz/www/mailserv/) to make it interface with majordomo
instead of just sending e-mail commands. Obviously, this is possible only
when majordomo is running on the same system as the web server. I would
like some feedback about my implementation.
First, it requires a minor addition to the majordomo script. Find the line
like this:
&sendmail(REPLY, $reply_to, "Majordomo results$sub_addin");
and put a couple lines around it:
&set_mailer($reply_mailer) if $reply_mailer;
&sendmail(REPLY, $reply_to, "Majordomo results$sub_addin");
&set_mailer($bounce_mailer) if $reply_mailer;
This changes the mailer program that majordomo uses to send results to the
user. $reply_mailer is not defined anywhere, so the change has no
effect on normal majordomo operation.
Next, make a copy of majordomo.cf, and name it majordomo-stdout.cf. Edit
the new file and add the following line:
$reply_mailer = "/path/strip_header -bogus -args";
strip_header is a simple perl script that strips off the initial mail
headers, then prints the message body to STDOUT. The bogus args are
ignored - they exist only because majordomo complains if you don't give
arguments to the mailer program.
Within the mailserv script, instead of sending an email message to the
majordomo address, I pipe the message (headers and all) into a command like:
/path/wrapper majordomo -C majordomo-stdout.cf
Then I retrieve the output and display it to the user.
This technique seems to work quite well, but I would appreciate any
comments and suggestions before I start using it.
--
________
/ _____ ) Patrick Fitzgerald Atlanta, GA
/ ___) / /__ fitz@iquest.com http://iquest.com/~fitz/
(_/ it(_____) webmaster@csicop.org http://www.csicop.org/
|
|