Skip to content

Commit

Permalink
fix outbound reply-to when no profile is enabled issue #291
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmunro committed Oct 12, 2018
1 parent af93ad1 commit 30c6772
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/smtp/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1212,14 +1212,19 @@ function smtp_refresh_oauth2_token_on_send($smtp_details, $mod, $smtp_id) {
if (!hm_exists('outbound_address_check')) {
function outbound_address_check($mod, $from, $reply_to) {
$domain = $mod->config->get('default_email_domain');
if (!$domain) {
if (array_key_exists('HTTP_HOST', $mod->request->server)) {
$domain = $mod->request->server['HTTP_HOST'];
}
}
if ($domain) {
if (!is_email_address($from)) {
$from = $from.'@'.$domain;
}
if (!is_email_address($reply_to)) {
if (!trim($reply_to)) {
$reply_to = $smtp_details['user'];
}
if (!trim($reply_to)) {
$reply_to = $from;
}
elseif (!is_email_address($reply_to)) {
$reply_to = $reply_to.'@'.$domain;
}
}
Expand Down

0 comments on commit 30c6772

Please sign in to comment.