View Issue Details

IDProjectCategoryView StatusLast Update
0025764mantisbtemailpublic2021-01-10 06:44
ReporterTomekAP Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Target Version2.25.0Fixed in Version2.25.0 
Summary0025764: Enable S/MIME signed e-mail notifications
Description

Now emails can not be signed, nevertheless, there is such option in phpmailer. I suggest adding in email_api.php at the end of section "case PHPMAILER_METHOD_SMTP:"

$t_mail->sign(config_get_global('cert_filename'), config_get_global('key_filename'), config_get_global('key_pass'), config_get_global('extracerts_filename '));

And add some variables in config_defaults_inc.php:

And in config_defaults_inc.php
/**

  • Path to mail certification file
  • @global string $g_cert_filename
    */
    $g_cert_filename = '';

/**

  • Path to mail private key file
  • @global string $g_key_filename
    */
    $g_key_filename = '';

/**

  • mail private key pass
  • @global string $g_key_pass
    */
    $g_key_pass = '';

/**

  • Path to mail extra certification file
  • @global string $g_sign_extracerts_file
    */
    $g_sign_extracerts_file = '';
TagsNo tags attached.

Activities

dregad

dregad

2019-05-16 04:19

developer   ~0062073

Feel free to submit a pull request on Github with a proposed implementation for review.

TomekAP

TomekAP

2019-05-17 08:03

reporter   ~0062085

I created branch, but can not push it:
Username for 'https://github.com': TomekAP
Password for 'https://TomekAP@github.com':
remote: Permission to mantisbt/mantisbt.git denied to TomekAp.
fatal: unable to access 'https://github.com/mantisbt/mantisbt.git/': The requested URL returned error: 403

dregad

dregad

2019-05-17 09:34

developer   ~0062086

You need to push to your own fork repository, i.e. https://github.com/TomekAP/mantisbt.git then on the GitHub UI, submit a pull request.

TomekAP

TomekAP

2019-05-17 10:44

reporter   ~0062088

now I hpe it is OK:
https://github.com/mantisbt/mantisbt/compare/master...TomekAp:master

dregad

dregad

2019-05-18 09:15

developer   ~0062092

@TomekAP almost there... you just need to actually click the Create pull request button to submit it for review.

TomekAP

TomekAP

2019-05-18 09:29

reporter   ~0062094

Now is it OK?
https://github.com/mantisbt/mantisbt/pull/1512

dregad

dregad

2019-05-19 06:42

developer   ~0062095

That's it. Will review as time allows

dregad

dregad

2019-12-09 06:46

developer   ~0063202

New PR https://github.com/mantisbt/mantisbt/pull/1591

Related Changesets

MantisBT: master 1bf2f040

2021-01-08 13:57:03

tsz


Committer: dregad Details Diff
Enable S/MIME signing of e-mails

Use existing PHPMailer functionality to allow MantisBT to sign outgoing
e-mail notifications.

Fixes 0025764

Signed-off-by: Damien Regad <dregad@mantisbt.org>

TomekAP's original contribution was modified as follows:
- Fix inconsistent naming of 'g_email_signing_sign_extracerts_file' in
config_defaults_inc.php, referenced everywhere else as
'g_email_signing_extracerts_file'
- Rename configs with prefix 'smime' instead of 'signing', to avoid any
confusion with DKIM which is also about signing
- Use suffix '_file' instead of '_filename'
- Fix whitespace
Affected Issues
0025764
mod - config_defaults_inc.php Diff File
mod - core/email_api.php Diff File

MantisBT: master 741d91f5

2021-01-08 13:59:25

dregad

Details Diff
Updated PHPDoc and added new configs in Admin Guide

Created a new 'S/MIME signature' section under Config / Email.

Issue 0025764
Affected Issues
0025764
mod - config_defaults_inc.php Diff File
mod - docbook/Admin_Guide/en-US/config/email.xml Diff File

MantisBT: master cb13a049

2021-01-08 14:05:46

dregad

Details Diff
Allow S/MIME signature for all mail methods

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 0025764
Affected Issues
0025764
mod - core/email_api.php Diff File

MantisBT: master e09ea350

2021-01-08 14:21:22

dregad

Details Diff
Add new $g_email_smime_enable setting

This allows calling PHPMailer::sign() only if necessary, and avoids
4 unnecessary config_get_global() calls if not.

Fixes 0025764
Affected Issues
0025764
mod - config_defaults_inc.php Diff File
mod - core/email_api.php Diff File
mod - docbook/Admin_Guide/en-US/config/email.xml Diff File