4 # cd ~webstump/live-SOMETHING
5 # formail < /path/to/mbox -s ./manual-reinject -f
6 # (mbox can sensibly be a folder in ~/mail)
8 # without -f means get the instance abbrev out of the Subject line
9 # -f means use this instance
22 } elsif (@ARGV==1 && $ARGV[0] eq '-f') {
27 my $sig = $ENV{'HOME'};
29 $sig .= '/.signature';
30 die $sig if stat $sig;
31 die unless $!==ENOENT;
37 if (m/^Subject: lost moderated newsgroup submission (\S+)/) {
45 last if m/^======================$/;
46 if (m/^Errors: inews: .*: 441 POST failed - .*: 441 435 Duplicate$/) {
51 my $art = IO::File::new_tmpfile;
52 defined $art or die $!;
57 print $art $_ or die $!;
59 if (m/^X-Moderation: \[([^][]+)\]/) {
67 print $art $_ or die $!;
70 STDIN->error and die $!;
71 $art->flush() or die $!;
72 seek $art,0,0 or die $!;
77 print "$xmodid - duplicate\n";
85 stat $obj or die "$obj $!";
92 $injector = './inews';
93 } elsif (!defined $abbrev) {
94 die "abbrev not found in outer Subject";
96 my $dir = $ENV{'PWD'};
98 my $env_stat = stat_ino $dir;
99 my $cwd_stat = stat_ino '.';
100 die "$env_stat != $cwd_stat" unless $env_stat eq $cwd_stat;
101 $dir =~ s#/live-\w[^/]*$#/live-$abbrev# or die "unexpected cwd $dir";
102 $injector = "$dir/inews";
105 print "$xmodid - $injector\n";
107 open STDIN, "<&", $art or die $!;