Browse Source

Update email_functions

master^2
Mike Koch 1 year ago
parent
commit
c11a9d3a80
No account linked to committer's email address
1 changed files with 17 additions and 1 deletions
  1. 17
    1
      inc/email_functions.inc.php

+ 17
- 1
inc/email_functions.inc.php View File

@@ -1010,5 +1010,21 @@ function hesk_generateMessageID() {
$id = uniqid('', true);
}

return '<' . $id . '.' . gmdate('YmdHis') . '@' . $_SERVER['SERVER_NAME'] . '>';
// If run from CLI, set the Hesk URL as host name
if (isset($_SERVER['SERVER_NAME'])) {
$host = $_SERVER['SERVER_NAME'];
} else {
global $hesk_settings;

$parts = parse_url($hesk_settings['hesk_url']);

if (empty($parts['host'])) {
$host = gethostname();
$host = str_replace('>', '', $host);
} else {
$host = $parts['host'];
}
}

return '<' . $id . '.' . gmdate('YmdHis') . '@' . $host . '>';
} // END hesk_generateMessageID()

Loading…
Cancel
Save