Skip to content

Commit

Permalink
Allow S/MIME signature for all mail methods
Browse files Browse the repository at this point in the history
The original implementation only enabled S/MIME signature for
PHPMAILER_METHOD_SMTP.

Moving the call to PHPMailer::sign() out of the switch() statement, so
it is also called when mail method is PHPMAILER_METHOD_SENDMAIL or
PHPMAILER_METHOD_MAIL.

Fixes #25764
  • Loading branch information
dregad committed Jan 8, 2021
1 parent 741d91f commit cb13a04
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions core/email_api.php
Expand Up @@ -1332,16 +1332,17 @@ function email_send( EmailData $p_email_data ) {

$t_mail->Port = config_get( 'smtp_port' );

$t_mail->sign(
config_get_global( 'email_smime_cert_file' ),
config_get_global( 'email_smime_key_file' ),
config_get_global( 'email_smime_key_password' ),
config_get_global( 'email_smime_extracerts_file' )
);

break;
}

# S/MIME signature
$t_mail->sign(
config_get_global( 'email_smime_cert_file' ),
config_get_global( 'email_smime_key_file' ),
config_get_global( 'email_smime_key_password' ),
config_get_global( 'email_smime_extracerts_file' )
);

#apply DKIM settings
if( config_get( 'email_dkim_enable' ) ) {
$t_mail->DKIM_domain = config_get( 'email_dkim_domain' );
Expand Down

0 comments on commit cb13a04

Please sign in to comment.