Advertisement
Sta99ot

pms.pl

Dec 1st, 2015
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.70 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # pms.pl
  4. # Perl Mail Spammer
  5. # by sta99ot
  6. # 2015
  7.  
  8. use Time::HiRes qw( usleep );
  9.  
  10. $from='from@email.com';
  11. $smtp_config='smtp.conf';
  12. $seconds_between_mails = 2;
  13.  
  14. @ARGV==2 or die("Usage: ./pms.pl formatted_mailfile.eml  mailboxes_list");
  15.  
  16. $mail_command = "msmtp -C \"$smtp_config\"";
  17. $mail_list_file = @ARGV[1];
  18. $mail_file = @ARGV[0];
  19.  
  20. open(LIST_FILE,"< $mail_list_file") or die;
  21.  
  22. while(<LIST_FILE>)
  23. {
  24.     chomp $_;
  25.     $email=$_;
  26.     $headers = "To: $email\\nFrom: $from";
  27.     $command = "echo \"$headers\" | cat - $mail_file | $mail_command $email";
  28.     print("Sending To: $email\n");
  29.     print(`$command`);
  30.     usleep(1000000 * $seconds_between_mails);
  31. }
  32. print("Done\n");
  33. close(LIST_FILE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement