#!/usr/bin/perl -w # # Absender muss us-ascii sein. # Eventuell Probleme bei mehrteiligen MIME Nachrichten (MIME::* lohnt?) # # Erstellt von Nikolaus Rath # %CONFIG = ( "submitter" => "Sven Hartge ", "sendmail" => "/usr/sbin/exim -t" ); use strict; use vars qw/%CONFIG/; exit(&main(@ARGV)); sub main(@) { my($line, $from, @newsgroups, $msgid, $date, $subject, $mime, $contentType, $encoding); # Header while (defined($_ = ) and $_ ne "\n") { /^From: (.+)$/i and $from = $1; /^Newsgroups: (.+)$/i and @newsgroups = split(/,/, $1); /^Message-ID: (.+)$/i and $msgid = $1; /^Date: (.+)$/i and $date = $1; /^Subject: (.+)$/i and $subject = $1; /^MIME-Version: (.+)$/i and $mime = $1; /^Content-Type: (.+)$/i and $contentType = $1; /^Content-Transfer-Encoding: (.+)$/i and $encoding = $1; } # Einreichen open(MTA, "|$CONFIG{'sendmail'}") or die "Can't start $CONFIG{'sendmail'}: $!\n"; print MTA "From: $CONFIG{'submitter'}\n"; print MTA "To: de-alt-netdigest\@moderators.dana.de\n"; # print MTA "To: oweh\n"; print MTA "Newsgroups: de.alt.netdigest\n"; $#newsgroups > 1 ? print MTA "Subject: [$newsgroups[0], ..] $subject\n" : print MTA "Subject: [$newsgroups[0]] $subject\n"; print MTA "MIME-Version: $mime\n"; print MTA "Content-Type: $contentType\n"; print MTA "Content-Transfer-Encoding: $encoding\n"; print MTA "\n"; # Body print MTA "From: $from\n"; print MTA "Newsgroups: ".join(", ", @newsgroups)."\n"; print MTA "Subject: $subject\n"; print MTA "Date: $date\n"; print MTA "Message-ID: $msgid\n\n"; while() { print MTA; } close(MTA); return 0; }