#! /bin/perl # @(#)pmcancel 1.2 (PGP Moose) 96/02/14 # Originally discovered in a message from tale@uunet.uu.net (David C Lawrence), # but I don't know if he is the original author or not. -- Greg Rose # $user below is used for the Approved: line # any existing control header is removed, as is any Distribution: (so # the cancel will go "world") # a new date header is inserted, and the message-id munged to have a # leading "cPROCESSID-" at the start of the original message-id # the subject is munged into the old style cmsg cancel form # the path is reset so it will propagate properly # the lines header is changed to reflect the new minimal body $* = 1; # let ^ and $ work with newlines embedded in input. $/ = ""; # read until empty line mode $_ = ; undef $/; # read in whole file mode $body = ; $user = `whoami` . '@' . `hostname`; $user =~ s/\n//g; $time = time; chop($date = `/usr/bin/date -u '+%d %h %y %T GMT'`); # nuke headers (if they exist) s/^Control: .*\n([ \t].*\n)*//i; s/^Distribution: .*\n([ \t].*\n)*//i; s/^X-Auth.*: PGPMoose.*\n([ \t].*\n)*//i; # replace headers (no big deal if Lines and/or Approved absent) s/^Date: .*\n([ \t].*\n)*/Date: $date\n/i; s/^Path: .*\n([ \t].*\n)*/Path: bounce-back\n/i; s/^Lines: .*\n([ \t].*\n)*/Lines: 1\n/i; s/^Approved: .*\n([ \t].*\n)*/Approved: $user\n/i; # cancel s/^Message-ID: <(.*)$/Message-ID: