Advertisement
Guest User

Untitled

a guest
Oct 4th, 2012
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. --- pastemon.pl.orig 2012-10-04 12:00:00.000000000 -0100
  2. +++ pastemon.pl 2012-10-04 12:00:01.000000000 -0100
  3. @@ -97,6 +97,7 @@
  4. my $smtpFrom;
  5. my $smtpRecipient;
  6. my $smtpSubject;
  7. +my @smtpRecipients;
  8.  
  9. my $distanceMin;
  10. my $distanceMaxSize;
  11. @@ -348,8 +349,7 @@
  12. # Optional: Add sample of data
  13. my $safeData = $matches{0}[2];
  14. # Sanitize the data
  15. - $safeData =~ s/
  16. -//g;
  17. + $safeData =~ s/\r/\\r/g;
  18. $safeData =~ s/\n/\\n/g;
  19. $safeData =~ s/\t/\\t/g;
  20. $buffer = $buffer . "| Sample: " . $safeData;
  21. @@ -366,7 +366,7 @@
  22. if ($smtpServer) {
  23. my $smtp = Net::SMTP->new($smtpServer) or die "Cannot create SMTP connection to $smtpServer: $?";
  24. $smtp->mail($smtpFrom);
  25. - $smtp->to($smtpRecipient);
  26. + $smtp->recipient(@smtpRecipients, { SkipBad => 1 });
  27. $smtp->data();
  28. my $subjectTags;
  29. for $key (keys %matches) {
  30. @@ -601,6 +601,8 @@
  31. $smtpRecipient = $node->find('recipient')->string_value;
  32. $smtpSubject = $node->find('subject')->string_value;
  33. }
  34. +
  35. + @smtpRecipients = split (/[, ]+/, $smtpRecipient);
  36.  
  37. # ---------------------
  38. # Parameters validation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement