Archived
1
0
Fork 0

No more use Email::Sender::Simple

This commit is contained in:
Mercier Pierre-Olivier 2013-09-19 20:57:47 +02:00
parent b5851bf5ed
commit 3ab8661fbf

View file

@ -12,7 +12,6 @@ use Net::LDAP::Util qw(ldap_error_text);
use Pod::Usage;
use Term::ANSIColor qw(:constants);
use Term::ReadKey;
use Quota;
#use Cwd 'abs_path';
#use File::Basename;
@ -1403,7 +1402,8 @@ sub cmd_ssh_keys_without_passphrase_warn(@)
print $entry->get_value("uid")."\n";
# create the message
use Email::MIME;
use Mail::Internet;
my $body = "Bonjour ".$entry->get_value("cn").",
Un outil automatique a découvert une clé sans passphrase sur votre compte
@ -1429,23 +1429,14 @@ PS: Ce message est g
--
Les roots ACU";
my $message = Email::MIME->create(
header_str => [
From => 'root@acu.epita.fr',
To => $entry->get_value("mailAlias"),
Cc => 'root@acu.epita.fr',
Subject => '[LAB][SSH-PASSPHRASE] Clef SSH non protégée',
],
attributes => {
encoding => 'quoted-printable',
charset => 'UTF-8',
},
body_str => $body,
);
# send the message
use Email::Sender::Simple qw(sendmail);
sendmail($message);
my $email = Mail::Internet->new();
$email->body($body);
$email->add( "To", $entry->get_value("mailAlias") );
$email->add( "Cc", "<root\@acu.epita.fr>" );
$email->add( "From", "Roots assistants <admin\@acu.epita.fr>" );
$email->add( "Subject", "[LAB][SSH-PASSPHRASE] Clef SSH non protégée" );
$email->send();
};
cmd_ssh_keys_without_passphrase_generic(\&$process);
@ -1494,23 +1485,14 @@ PS: Ce message est g
--
Les roots ACU";
my $message = Email::MIME->create(
header_str => [
From => 'root@acu.epita.fr',
To => $entry->get_value("aliasmail"),
Cc => 'root@acu.epita.fr',
Subject => '[LAB][SSH-PASSPHRASE] Clé SSH non protégée supprimée',
],
attributes => {
encoding => 'quoted-printable',
charset => 'UTF-8',
},
body_str => $body,
);
# send the message
use Email::Sender::Simple qw(sendmail);
sendmail($message);
my $email = Mail::Internet->new();
$email->body($body);
$email->add( "To", $entry->get_value("mailAlias") );
$email->add( "Cc", "<root\@acu.epita.fr>" );
$email->add( "From", "Roots assistants <admin\@acu.epita.fr>" );
$email->add( "Subject", "[LAB][SSH-PASSPHRASE] Clef SSH non protégée supprimée" );
$email->send();
};
cmd_ssh_keys_without_passphrase_generic(\&$process);