well. yes, and unmodified this is "to be expected", because simply put: invites that are "internal" are not per default referenced via SMTP addresses, but instead with X500 (EX type) addresses from GAL (Global Addresslist) via NSPI (Name Service Provider Interface) - in short: your global addressbook.
you would face the same issue, exporting the PST, importing it to a different exchange -> the X500 addressing is then simply different (per installation).
but - look here: https://docs.grommunio.com/man/gromox-mbop-8/#exaddrxlat
I hope nobody from professional services will kill me, but here a detailed explanation on how you can do that (dont tell MS 😉)
like documented (see above), the -m file uses the kdb-uidextract(8) format: a JSON array of objects. exaddrxlat only uses two keys:
[
{"dn": "/o=Org/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=0a1b...-jdoe",
"to": "jdoe@domain.example"}
]
for each sender, representing, received-by, original-author and similar set of properties, it does this:
- if an …_SMTP_ADDRESS property exists, it uses that directly and needs no map entry. This only exists for sender and sent-representing.
- Otherwise, if the addrtype is EX, it looks up …_EMAIL_ADDRESS in the map.
- The lookup is an exact, case-sensitive string match, required I think by design. Exchange DNs show up in messages in several spellings (/O=ORG/OU=… and /o=Org/ou=…). Add each DN in every spelling that actually appears in the store, or at least as-is and in uppercase.
example: read-only against the user's exmdb/exchange.sqlite3 (or loop over all users). It catches any property whose value looks like a DN, in message and recipient properties:
DB=/var/lib/gromox/user/yournamehere/exmdb/exchange.sqlite3
sqlite3 -readonly "$DB" "
SELECT DISTINCT CAST(propval AS TEXT) FROM message_properties
WHERE CAST(propval AS TEXT) LIKE '/o=%'
UNION
SELECT DISTINCT CAST(propval AS TEXT) FROM recipients_properties
WHERE CAST(propval AS TEXT) LIKE '/o=%';" | sort -u > ex-dns.txt
ex-dns.txt is the list you have to cover.
so, lets get practical here:
step 1 - exchange
you need every DN that mail could refer to: each recipient's current LegacyExchangeDN, its X500: proxy addresses (DNs from earlier orgs or migrations), and the DNs of people who have since left.
$rows = [System.Collections.Generic.List[object]]::new()
function Add-Map($dn, $to) {
if (-not $dn -or -not $to) { return }
# exaddrxlat matches case-sensitively; items carry both spellings
foreach ($v in @($dn, $dn.ToUpper()) | Sort-Object -Unique) {
$rows.Add([pscustomobject]@{ dn = $v; to = [string]$to })
}
}
# live recipients: mailboxes, groups, contacts, rooms, mail-enabled PFs
foreach ($r in Get-Recipient -ResultSize Unlimited) {
$to = $r.PrimarySmtpAddress
Add-Map $r.LegacyExchangeDN $to
$r.EmailAddresses | Where-Object PrefixString -eq 'X500' |
ForEach-Object { Add-Map $_.AddressString $to }
}
# departed users still in the AD recycle bin
Get-ADObject -IncludeDeletedObjects -Filter 'isDeleted -eq $true -and legacyExchangeDN -like "*"' `
-Properties legacyExchangeDN, proxyAddresses, mail |
ForEach-Object {
$to = $_.mail
Add-Map $_.legacyExchangeDN $to
$_.proxyAddresses | Where-Object { $_ -like 'X500:*' } |
ForEach-Object { Add-Map $_.Substring(5) $to }
}
$json = ConvertTo-Json -InputObject @($rows) -Depth 2
[IO.File]::WriteAllText("$PWD\exaddr-map.json", $json,
(New-Object Text.UTF8Encoding $false))
- In case of Exchange Online (M365): use Get-EXORecipient, and add Get-Mailbox -InactiveMailboxOnly / -SoftDeletedMailbox to cover people who have left.
step 2 - grommunio
ORG='Gromox default' # OR x500_org_name from gromox.cfg
for db in /var/lib/gromox/user/*/*/exmdb/exchange.sqlite3 /var/lib/gromox/domain/*/exmdb/exchange.sqlite3; do
sqlite3 -readonly "$db" "
SELECT CAST(propval AS TEXT) FROM message_properties
WHERE CAST(propval AS TEXT) LIKE '/o=%'
UNION
SELECT CAST(propval AS TEXT) FROM recipients_properties
WHERE CAST(propval AS TEXT) LIKE '/o=%';"
done | grep -v -i "^/o=$ORG/" | sort -u > ex-dns.txt
step 3 - check gaps and fill (potentially manual)
jq -r '.[].dn' exaddr-map.json | sort -u > mapped.txt
comm -23 ex-dns.txt mapped.txt # DNs in mail with no map entry
step 4 - magic
then run it per mailbox (for the public store with -d):
gromox-mbop -u user@domain.at exaddrxlat -m exaddr-map.json -r IPM_SUBTREE
gromox-mbop -d /var/lib/gromox/domain/<domain> exaddrxlat -m exaddr-map.json -r IPM_SUBTREE
For convenience you can also use foreach.mb.here before you start scripting a loop over all users.