mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

reminder.pl (481B)


      1 #!/usr/bin/perl
      2 
      3 my $subject, $msgid, $body = 0;
      4 
      5 while (<>) {
      6   if ($body) {
      7     print;
      8     next;
      9   }
     10   chop;
     11   if (/^Subject: (.*)$/) {
     12     $subject = $1;
     13   }
     14   if (/^Message-[Ii][Dd]: (.*)$/) {
     15     $msgid = $1;
     16   }
     17   if (/^$/) {
     18     if (!$body) {
     19       print "From: Reminder <a3nm\@localhost>\n";
     20       print "To: Antoine Amarilli <a3nm\@localhost>\n";
     21       print "Subject: PING $subject\n";
     22       print "In-Reply-To: $msgid\n";
     23       print "\n";
     24       $body = 1;
     25     }
     26   }
     27 }
     28