<commit_before>#!/usr/bin/perl
use strict;
use warnings;
use Net::SMTP_auth;
use Email::Address;
use Data::Dumper;

my $user = getpwuid( $< );
my $smtp_password = '<PASSWORD>';
my $smtp_default_password = '<PASSWORD>';

my $input = '';
my $to_string = '';
foreach my $line ( <STDIN> ) {
  $input .= $line;
  if ($line =~ /^To:/) {
    $to_string = $line;
  }
}

my @addrs = Email::Address->parse($to_string);

if (0+@addrs eq 0) {
  die "No recipients";
}

my $rec = $addrs[0];
$rec =~ s/\@/\\@/;

my $smtp = Net::SMTP_auth->new('127.0.0.1', Port => 25, Timeout => 10, Debug => 0);
die "Could not connect to SMTP server!\n" unless $smtp;
if (!$smtp->auth('PLAIN', $user.'@<EMAIL>', $smtp_password)) {
 $smtp->auth('PLAIN', '<EMAIL>', $smtp_default_password) or die "Auth failed!\n";
}
$smtp->mail($user . '\<EMAIL>');
$smtp->to($rec);
$smtp->data();
$smtp->datasend($input);
$smtp->dataend();<commit_msg>Removed unused module (Data::Dumper)<commit_after>#!/usr/bin/perl
use strict;
use warnings;
use Net::SMTP_auth;
use Email::Address;

my $user = getpwuid( $< );
my $smtp_password = 'password';
my $smtp_default_password = 'password';

my $input = '';
my $to_string = '';
foreach my $line ( <STDIN> ) {
  $input .= $line;
  if ($line =~ /^To:/) {
    $to_string = $line;
  }
}

my @addrs = Email::Address->parse($to_string);

if (0+@addrs eq 0) {
  die "No recipients";
}

my $rec = $addrs[0];
$rec =~ s/\@/\\@/;

my $smtp = Net::SMTP_auth->new('127.0.0.1', Port => 25, Timeout => 10, Debug => 0);
die "Could not connect to SMTP server!\n" unless $smtp;
if (!$smtp->auth('PLAIN', $user.'@<EMAIL>', $smtp_password)) {
 $smtp->auth('PLAIN', '<EMAIL>', $smtp_default_password) or die "Auth failed!\n";
}
$smtp->mail($user . '\<EMAIL>');
$smtp->to($rec);
$smtp->data();
$smtp->datasend($input);
$smtp->dataend();
{'fraction_non_alphanumeric': 0.2448866777224986, 'fraction_numerical': 0.015478164731896076, 'mean_word_length': 4.552147239263804, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7617264', 'n_tokens_mistral': 799, 'n_tokens_neox': 749, 'n_words': 170}