--- sequencer.orig Wed Nov 15 11:50:16 2000 +++ sequencer Fri Nov 17 18:52:14 2000 @@ -64,6 +64,8 @@ require "getopts.pl"; require "config_parse.pl"; require "shlock.pl"; +require "mimer.pl"; +require "mimew.pl"; &Getopts("Aa:df:h:I:l:m:M:nNp:Rr:s") || die("sequencer: Getopts() failed: $!"); @@ -74,6 +76,9 @@ # smash case for the list name $opt_l =~ tr/A-Z/a-z/; +# sendmail path setting +$sendmail_path = "/usr/sbin/sendmail"; + if ( ! @ARGV) { die("sequencer: must specify outgoing list as last arg(s)"); } @@ -153,6 +158,17 @@ &abort("sequencer: Can't open /tmp/sequencer.$$.in: $!"); while () { + if ( (/^subject:/i) || (defined($subj_last)) ) { + if ( (/^subject:/i) || (/^\s+(.+)/) ) { + $_ = &mimedecode($_); + $_ = &mimeencode($_); + s/R[eE]\:.*[\(\[].*\d+[\)\]]/Re\:/; + s/R[eE]\:\s+R[eE]\:/Re\:/g; + $subj_last = 1; + } else { + undef($subj_last); + } + } print IN $_; } @@ -195,8 +211,8 @@ $foo = $foo . " "; } } - $subject = $foo . "Message for " . $opt_l; - print OUT $subject, "\n"; + $subject = $foo . "(No Subject in original)"; + print OUT "Subject: ", $subject, "\n"; } print OUT "Sender: $sender\n"; @@ -262,22 +278,31 @@ } # prepend subject prefix - if ( (/^subject:\s*/i) && - ($config_opts{$opt_l,"subject_prefix"} ne '') - ) { + if (/^subject:\s*/i) { local($foo) = &config'substitute_values( $config_opts{$opt_l,"subject_prefix"}, $opt_l); + if ($config_opts{$opt_l,"subject_prefix"} ne '') { # 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 ) { @@ -399,7 +424,7 @@ &bounce("Approval required"); } -$sendmail_cmd = "/usr/lib/sendmail $opt_m -f$sendmail_sender " . +$sendmail_cmd = "$sendmail_path $opt_m -f$sendmail_sender " . join(" ", @ARGV); if (defined($opt_d)) { @@ -421,7 +446,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 = &mimedecode($subject); + $decoded_from = &mimedecode($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"); @@ -541,9 +569,9 @@ if (defined($opt_d)) { # debugging, so just say it, don't do it open(MAIL, ">-"); - print MAIL ">>> /usr/lib/sendmail -f$sendmail_sender -t\n"; + print MAIL ">>> $sendmail_path -f$sendmail_sender -t\n"; } else { - local(@mailer) = split(' ',"/usr/lib/sendmail -f$sendmail_sender -t"); + local(@mailer) = split(' ',"$sendmail_path -f$sendmail_sender -t"); open(MAIL, "|-") || &do_exec_sendmail(@mailer); } --- majordomo.cf.orig Fri Nov 17 15:07:33 2000 +++ majordomo.cf Fri Nov 17 12:42:09 2000 @@ -140,7 +140,7 @@ # What command should I use to process an "index" request? # -$index_command = "/bin/ls -lRL"; +$index_command = "/bin/cat INDEX"; # If you want to use FTPMAIL, rather than local access, for file transfer # and access, define the following: