
open S, "<", "/tmp/sub" or die;
my $MSG = join "", <S>;

while (<>) {
  chomp;
  my $msg = $MSG;
  my $s = $_;
  $s =~ s/\@/=/;
  $s = "mjd-books-subscribe-$s\@plover.com";
  $msg =~ s/%%ADDR%%/$_/g;
  $msg =~ s/%%SADDR%%/$s/g;
  open M, "| /var/qmail/bin/qmail-inject $s" or die;
  print M $msg;
  close M or die $!;
  print "$_\n";
}
