Skip to content

Commit de0cd1c

Browse files
committed
Retrieve smtp address via addressbook
References: Issue #135
1 parent 4238133 commit de0cd1c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/grommunio/grommunio.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,6 +2208,17 @@ private function openMessageStore($user) {
22082208
$this->storeCache[$user] = $store;
22092209
}
22102210

2211+
// g-sync135: always use SMTP address (issue with altnames)
2212+
if (!$return_public) {
2213+
$addressbook = $this->getAddressbook();
2214+
$storeProps = mapi_getprops($store, [PR_MAILBOX_OWNER_ENTRYID]);
2215+
$mailuser = mapi_ab_openentry($addressbook, $storeProps[PR_MAILBOX_OWNER_ENTRYID]);
2216+
$smtpProps = mapi_getprops($mailuser, [PR_SMTP_ADDRESS]);
2217+
if (isset($smtpProps[PR_SMTP_ADDRESS])) {
2218+
Request::SetUserIdentifier($smtpProps[PR_SMTP_ADDRESS]);
2219+
}
2220+
}
2221+
22112222
SLog::Write(LOGLEVEL_DEBUG, sprintf("Grommunio->openMessageStore('%s'): Found '%s' store: '%s'", $user, ($return_public) ? 'PUBLIC' : 'DEFAULT', $store));
22122223

22132224
return $store;

0 commit comments

Comments
 (0)