mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-17 19:38:25 +01:00
ensure Message-Id is the same for outgoing mail AND message saved in send-folder
This commit is contained in:
parent
2172fc769d
commit
dc965c15f9
@ -2147,12 +2147,26 @@ class mail_compose
|
|||||||
return $_body;
|
return $_body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function _getHostName()
|
||||||
|
{
|
||||||
|
if (isset($_SERVER['SERVER_NAME'])) {
|
||||||
|
$result = $_SERVER['SERVER_NAME'];
|
||||||
|
} else {
|
||||||
|
$result = 'localhost.localdomain';
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
function createMessage(&$_mailObject, $_formData, $_identity, $_signature = false, $_convertLinks=false)
|
function createMessage(&$_mailObject, $_formData, $_identity, $_signature = false, $_convertLinks=false)
|
||||||
{
|
{
|
||||||
$mail_bo = $this->mail_bo;
|
$mail_bo = $this->mail_bo;
|
||||||
$_mailObject->PluginDir = EGW_SERVER_ROOT."/phpgwapi/inc/";
|
$_mailObject->PluginDir = EGW_SERVER_ROOT."/phpgwapi/inc/";
|
||||||
$activeMailProfile = emailadmin_account::read($this->mail_bo->profileID);
|
$activeMailProfile = emailadmin_account::read($this->mail_bo->profileID);
|
||||||
$_mailObject->IsSMTP();
|
$_mailObject->IsSMTP();
|
||||||
|
// we make sure the message ID is set here, that way, we make sure its not created on the fly upon header creation
|
||||||
|
$host = self::_getHostName();
|
||||||
|
if (empty($_mailObject->MessageID)) $_mailObject->MessageID = '<'.md5(uniqid(time())).'@'.trim($host?$host:'localhost').'>';
|
||||||
|
|
||||||
$_mailObject->CharSet = $this->displayCharset;
|
$_mailObject->CharSet = $this->displayCharset;
|
||||||
// you need to set the sender, if you work with different identities, since most smtp servers, dont allow
|
// you need to set the sender, if you work with different identities, since most smtp servers, dont allow
|
||||||
// sending in the name of someone else
|
// sending in the name of someone else
|
||||||
@ -2621,6 +2635,7 @@ class mail_compose
|
|||||||
$mail->Username = $username;
|
$mail->Username = $username;
|
||||||
$mail->Password = $ogServer->password;
|
$mail->Password = $ogServer->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we switch back from authentication data to the account we used to work on
|
// we switch back from authentication data to the account we used to work on
|
||||||
if ($_formData['serverID']!=$_formData['mailaccount'])
|
if ($_formData['serverID']!=$_formData['mailaccount'])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user