Merge branch 'develop' of github.com:humhub/humhub into develop

# Conflicts:
#	protected/humhub/docs/CHANGELOG_DEV.md
This commit is contained in:
buddh4 2019-09-19 14:54:35 +02:00
commit 3564f302ed
3 changed files with 37 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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