The following (previously undocumented) function from the formula language can be used to query a user's mail home server.
@LocationGetInfo([HomeServer])
This function is still not documented in R5, but has reliably returned the name of the home server since R4.6.
Lotus itself uses this command in various standard templates. You can therefore be fairly confident that this command will also work in future versions.