Bary,
Patrick Wiseman wrote a great anonymizer which I setup on our server recently. Get it from the
list archive at
<http://www.greatcircle.com/lists/majordomo-users/mhonarc/majordomo-users.9901/msg00258.html>. Based
on his work, I wrote one which handles multipart mail in a rudimentary way. My script is attached
below. When you choose which script you want to use, consider weather you want to allow attachments
to be sent to your lists. If you are interested in preventing attachments, check the archive for a
discussion of how to accomplish this.
Regards,
Colin Hill
IS Specialist, Nortel Networks
-------------------- Snip -------------------------- Snip ------------
#!/usr/bin/perl
#
# anonmail.pl
#
# Anonymizer by Colin T. Hill
# based on anon.pl by Patrick Wiseman
# which was very loosely based on a script by Tom Ryan
#
# Alias Example:
# anon-test: "|/usr/local/majordomo/bin/anonmail.pl"
# Assumes the existance of:
# test: "|/usr/local/majordomo/wrapper resend -l test test-list"
# And associated aliases
#
$SENDMAIL = '/usr/sbin/sendmail';
while (<>) {
push(@headers,$_) if s/^To:[\s](anon-)(.[^\@]*)\@.*/To: \"Recipients of \2\" \<\2\>/;
push(@headers,$_) if m/^Subject:/i;
push(@headers,$_) if m/^Content-type:/i;
push(@headers,$_) if m/^MIME-version:/i;
push(@headers,$_) if m/^Content-transfer-encoding:/i;
push(@headers,$_) if m/^\s+\S+$/; # Maintain Multiline Headers
last if /^$/; # End of headers
}
# I know the multiline header code looks as though it shouldn't work, but
# resend seems to clean up the carnage quite nicely.
# The anonymizer
# This sends the anonymized message directly to the list 'resend' alias
# to secure bounced messages. This has the drawback of not allowing the
# sender to recieve bounces / usage instructons etc.
#
open (MAIL, "|$SENDMAIL -F Anonymous -f anon -t")
|| die "Anonymizer: Can't open $SENDMAIL: $!\n";
for $header (@headers) { print MAIL $header;} print "\n";
while (<>) { print MAIL } close (MAIL);
-------------------- Snip -------------------------- Snip ------------
References:
|
|