mirror of
https://github.com/humhub/humhub.git
synced 2025-04-22 08:03:35 +02:00
Merge branch 'develop' of github.com:humhub/humhub into develop
# Conflicts: # protected/humhub/docs/CHANGELOG_DEV.md
This commit is contained in:
commit
3564f302ed
@ -31,6 +31,27 @@ class Mailer extends \yii\swiftmailer\Mailer
|
||||
* @since 1.3
|
||||
*/
|
||||
public $surpressedRecipients = ['david.roberts@example.com', 'sara.schuster@example.com'];
|
||||
|
||||
/**
|
||||
* @var string|null Path for the sigining certificate. If provided emails will be digitally signed before sending.
|
||||
*/
|
||||
public $signingCertificatePath = null;
|
||||
|
||||
/**
|
||||
* @var string|null Path for the sigining certificate private key. If provided emails will be digitally signed before sending.
|
||||
*/
|
||||
public $signingPrivateKeyPath = null;
|
||||
|
||||
/**
|
||||
* @var string|null Path for extra sigining certificates (i.e. intermidiate certificates).
|
||||
*/
|
||||
public $signingExtraCertsPath = null;
|
||||
|
||||
/**
|
||||
* @var int Bitwise operator options for openssl_pkcs7_sign()
|
||||
*/
|
||||
public $signingOptions = PKCS7_DETACHED;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new message instance and optionally composes its body content via view rendering.
|
||||
@ -61,6 +82,11 @@ class Mailer extends \yii\swiftmailer\Mailer
|
||||
$message->setFrom([Yii::$app->settings->get('mailer.systemEmailAddress') => Yii::$app->settings->get('mailer.systemEmailName')]);
|
||||
}
|
||||
|
||||
if ($this->signingCertificatePath !== null && $this->signingPrivateKeyPath !== null) {
|
||||
$message->setSmimeSigner($this->signingCertificatePath, $this->signingPrivateKeyPath, $this->signingOptions, $this->signingExtraCertsPath);
|
||||
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
@ -16,4 +16,14 @@ namespace humhub\components\mail;
|
||||
*/
|
||||
class Message extends \yii\swiftmailer\Message
|
||||
{
|
||||
public function setSmimeSigner($signingCertificatePath, $signingPrivateKeyPath, $signingOptions = PKCS7_DETACHED, $extraCerts = null)
|
||||
{
|
||||
$signer = \Swift_Signers_SMimeSigner::newInstance();
|
||||
|
||||
$signer->setSignCertificate($signingCertificatePath, $signingPrivateKeyPath, $signingOptions, $extraCerts);
|
||||
|
||||
$this->getSwiftMessage()->attachSigner($signer);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@ -53,4 +53,5 @@ HumHub Change Log (DEVELOP)
|
||||
- Fix #3404 Richtext `Heading` text not translatable
|
||||
- Fix #3642 Welcome tour not using community name
|
||||
- Chng: Moved collapsible panel logic into own js module
|
||||
- Enh #3649: Provide a way to S/MIME sign e-mails (@ChadiRachid)
|
||||
- Fix `humhub\modules\file\widgets\Upload::progress` config options not working
|
||||
|
Loading…
x
Reference in New Issue
Block a user