Merge branch 'ent-12063-16194-compilador-perl-packer-tiene-mal-encoding-en-japones' into 'develop'

Ent-12063-16194-compilador-perl-packer-tiene-mal-encoding-en-japones

Closes pandora_enterprise#12063

See merge request artica/pandorafms!6844
This commit is contained in:
Daniel Rodriguez 2024-01-24 15:20:50 +00:00
commit 3300ab0870
3 changed files with 9 additions and 1 deletions

View File

@ -816,3 +816,5 @@ madeserver_autofit 7d
# Model sensitivity. A lower value triggers less anomalies (PANDORA FMS ENTERPRISE ONLY).
madeserver_sensitivity 0.1
# Encoding to use on mail subject (MIME-Header by default)
# mail_subject_encoding MIME-Header-ISO_2022_JP

View File

@ -589,6 +589,8 @@ sub pandora_load_config {
$pa_config->{"madeserver"} = 0; # 774.
$pa_config->{"mail_subject_encoding"} = 'MIME-Header'; # 776.
# Check for UID0
if ($pa_config->{"quiet"} != 0){
if ($> == 0){
@ -691,6 +693,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^mail_in_separate\s+([0-9]*)/i) {
$pa_config->{'mail_in_separate'}= clean_blank($1);
}
elsif ($parametro =~ m/^mail_subject_encoding\s(.*)/i) {
$pa_config->{'mail_subject_encoding'}= clean_blank($1);
}
elsif ($parametro =~ m/^snmp_logfile\s(.*)/i) {
$pa_config->{'snmp_logfile'}= clean_blank($1);
}

View File

@ -748,6 +748,7 @@ sub pandora_sendmail {
my $subject = $_[2];
my $message = $_[3];
my $content_type = $_[4];
my $encoding = $pa_config->{"mail_subject_encoding"} || 'MIME-Header';
$subject = decode_entities ($subject);
@ -758,7 +759,7 @@ sub pandora_sendmail {
my %mail = ( To => $to_address,
Message => $message,
Subject => encode('MIME-Header', $subject),
Subject => encode($encoding, $subject),
'X-Mailer' => $pa_config->{"rb_product_name"},
Smtp => $pa_config->{"mta_address"},
Port => $pa_config->{"mta_port"},