#!/usr/bin/perl # # # smartlist-approve: a filter to take an email message sent to a smartlist # moderator when a message is sent to the list, # and repost it to the list with a Approved: header. # # By Alan Schwartz 1996 # # # Usage: pipe mail message to # smartlist-approve # # Example: cat message | smartlist-approve recipes@gourmet.org # # Set this to point to where your sendmail program is located: $sendmail='/usr/lib/sendmail'; # Set this to your email address as a moderator $email='myaddress@myhost'; die "Usage: $0 \n" unless ($list = $ARGV[0]); die "Unable to call $sendmail\n" unless open(OUT,"|$sendmail $list"); # Print out the headers, except any escaped >From header while () { last if /^$/; print OUT unless /^>From/; } # Add the Approved: header and a blank line print OUT "Approved: $email\n\n"; # Print the rest of the body print OUT ; close OUT;