--- /home6/ml-making/majordomo-1.94.4/contrib/sequencer Tue Dec 10 01:50:48 1996 +++ ./sequencer Sat Aug 1 19:48:02 1998 @@ -1,5 +1,6 @@ #!/usr/bin/perl -U - +use IM::Config; +use IM::EncDec; # Copyright 1996 MACS, Inc. # Copyright 1992, D. Brent Chapman. See the Majordomo license agreement # for usage rights. @@ -196,7 +197,7 @@ } } $subject = $foo . "Message for " . $opt_l; - print OUT $subject, "\n"; + print OUT 'Subject: ', $subject,"\n"; } print OUT "Sender: $sender\n"; @@ -204,7 +205,7 @@ print OUT "Precedence: $opt_p\n"; } if (defined($opt_r)) { - print OUT "Reply-To: ", &config'substitute_values($opt_r), + print OUT "Reply-To: ", &config'substitute_values($opt_r), "@", $whereami, "\n"; } @@ -212,6 +213,7 @@ if ( $config_opts{$opt_l,"message_headers"} ne '' ) { local($headers) = &config'substitute_values ( $config_opts{$opt_l,"message_headers"}, $opt_l); + $headers =~ s/\$SEQNUM/$seqnum/; $headers =~ s/\001/\n/g; print OUT $headers; } @@ -262,23 +264,34 @@ } # prepend subject prefix - if ( (/^subject:\s*/i) && - ($config_opts{$opt_l,"subject_prefix"} ne '') - ) { + if (/^subject:\s*/i) { + if ($config_opts{$opt_l,"subject_prefix"} ne '') { local($foo) = &config'substitute_values( $config_opts{$opt_l,"subject_prefix"}, $opt_l); # for sequencing we add a special keyword! if (defined($opt_n)) { $foo =~ s/\$SEQNUM/$seqnum/; } + } $subject = $_; $subject =~ s/^subject:\s*(.*)/$1/i; $subject = &chop_nl($foo . " " . $subject); local($foo_pat) = $foo; $foo_pat =~ s/(\W)/\\$1/g; s/^subject:\s*/Subject: $foo /i if !/$foo_pat/; + $subject_last = 1 ; } - + elsif ( defined($subject_last) ) + { + if ( /^\s+(.+)/ ) + { + $subject .= " $1"; + } + else + { + undef($subject_last); + } + } if ( /^from:\s*(.+)/i ) { $from = $1; @@ -399,7 +412,7 @@ &bounce("Approval required"); } -$sendmail_cmd = "/usr/lib/sendmail $opt_m -f$sendmail_sender " . +$sendmail_cmd = "/usr/sbin/sendmail $opt_m -f$sendmail_sender " . join(" ", @ARGV); if (defined($opt_d)) { @@ -421,7 +434,10 @@ if (defined($opt_N)) { if (open (INDEX, ">>$filedir/$opt_l$filedir_suffix/INDEX")) { $timenow = localtime(time); - printf(INDEX "%s\n\tFrom %s on %s\n", $subject, $from, $timenow); + $decoded_subject = mime_decode_string($subject); + $decoded_from = mime_decode_string($from); + printf(INDEX "%5d %s\n\tFrom %s on %s\n", + $seqnum, $decoded_subject, $decoded_from, $timenow); close (INDEX); } open (ARCHIVE, ">$filedir/$opt_l$filedir_suffix/$seqnum");