Change Message-ID regenerate logic (#1432)

Add additional configuration to hide x-mailer header  (#1426)
This commit is contained in:
RainLoop Team 2017-05-18 20:40:27 +03:00
parent 74700afa6c
commit 879ffb3e37
2 changed files with 15 additions and 4 deletions

View file

@ -5877,9 +5877,11 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$sReferences = $this->GetActionParam('References', '');
$oMessage = \MailSo\Mime\Message::NewInstance();
$oMessage->RegenerateMessageId();
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
if (!$this->Config()->Get('security', 'hide_x_mailer_header', false))
{
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
}
$oFromIdentity = $this->GetIdentityByID($oAccount, $sIdentityID);
if ($oFromIdentity)
@ -5892,6 +5894,9 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$oMessage->SetFrom(\MailSo\Mime\Email::Parse($oAccount->Email()));
}
$oFrom = $oMessage->GetFrom();
$oMessage->RegenerateMessageId($oFrom ? $oFrom->GetDomain() : '');
if (!empty($sReplyTo))
{
$oReplyTo = \MailSo\Mime\EmailCollection::NewInstance($sReplyTo);
@ -6063,12 +6068,17 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
$oMessage = \MailSo\Mime\Message::NewInstance();
$oMessage->RegenerateMessageId();
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
if (!$this->Config()->Get('security', 'hide_x_mailer_header', false))
{
$oMessage->SetXMailer('RainLoop/'.APP_VERSION);
}
$oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oIdentity->Email(), $oIdentity->Name()));
$oFrom = $oMessage->GetFrom();
$oMessage->RegenerateMessageId($oFrom ? $oFrom->GetDomain() : '');
$sReplyTo = $oIdentity->ReplyTo();
if (!empty($sReplyTo))
{