Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jepf committed Jun 9, 2022
1 parent 0933cbc commit a8e64fb
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions Kernel/Output/HTML/ArticleCheck/SMIME.pm
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,20 @@ sub Check {
Email => \@OrigEmail,
);

my $OrigFrom = $ParserObjectOrig->GetParam( WHAT => 'From' );
my $OrigFromEmail = $ParserObjectOrig->GetEmailAddress( Email => $OrigFrom );
my $OrigSender = $ParserObjectOrig->GetParam( WHAT => 'Sender' );
my $OrigFrom = $ParserObjectOrig->GetParam( WHAT => 'From' );
my $OrigFromEmail = $ParserObjectOrig->GetEmailAddress( Email => $OrigFrom );
my $OrigSender = $ParserObjectOrig->GetParam( WHAT => 'Sender' );
my $OrigSenderEmail = $ParserObjectOrig->GetEmailAddress( Email => $OrigSender );

# compare sender email to signer email
my $SignerSenderMatch = 0;
SIGNER:
for my $Signer ( @{ $SignCheck{Signers} } ) {
if ( $OrigFromEmail =~ m{\A \Q$Signer\E \z}xmsi || $OrigSenderEmail =~ m{\A \Q$Signer\E \z}xmsi ) {
if (
$OrigFromEmail =~ m{\A \Q$Signer\E \z}xmsi
|| $OrigSenderEmail =~ m{\A \Q$Signer\E \z}xmsi
)
{
$SignerSenderMatch = 1;
last SIGNER;
}
Expand All @@ -295,7 +299,7 @@ sub Check {
$SignCheck{Message} .= " (signed by "
. join( ' | ', @{ $SignCheck{Signers} } )
. ")"
. ", but neither $OrigFromEmail nor $OrigSenderEmail does match certificate address!";
. ", but neither $OrigFromEmail nor $OrigSenderEmail match the certificate address!";
}

# Determine if we have decrypted article and attachments before.
Expand Down Expand Up @@ -399,16 +403,20 @@ sub Check {
Email => \@OrigEmail,
);

my $OrigFrom = $ParserObjectOrig->GetParam( WHAT => 'From' );
my $OrigFromEmail = $ParserObjectOrig->GetEmailAddress( Email => $OrigFrom );
my $OrigSender = $ParserObjectOrig->GetParam( WHAT => 'Sender' );
my $OrigFrom = $ParserObjectOrig->GetParam( WHAT => 'From' );
my $OrigFromEmail = $ParserObjectOrig->GetEmailAddress( Email => $OrigFrom );
my $OrigSender = $ParserObjectOrig->GetParam( WHAT => 'Sender' );
my $OrigSenderEmail = $ParserObjectOrig->GetEmailAddress( Email => $OrigSender );

# compare sender email to signer email
my $SignerSenderMatch = 0;
SIGNER:
for my $Signer ( @{ $SignCheck{Signers} } ) {
if ( $OrigFromEmail =~ m{\A \Q$Signer\E \z}xmsi || $OrigSenderEmail =~ m{\A \Q$Signer\E \z}xmsi ) {
if (
$OrigFromEmail =~ m{\A \Q$Signer\E \z}xmsi
|| $OrigSenderEmail =~ m{\A \Q$Signer\E \z}xmsi
)
{
$SignerSenderMatch = 1;
last SIGNER;
}
Expand All @@ -421,7 +429,7 @@ sub Check {
$SignCheck{Message} .= " (signed by "
. join( ' | ', @{ $SignCheck{Signers} } )
. ")"
. ", but neither $OrigFromEmail nor $OrigSenderEmail does match certificate address!";
. ", but neither $OrigFromEmail nor $OrigSenderEmail match the certificate address!";
}

# Determine if we have decrypted article and attachments before.
Expand Down

0 comments on commit a8e64fb

Please sign in to comment.