Another update... I started fresh with a new install of Lion. Updated to 10.7.3 first, having read about everyone's nightmares after this update.
Anyway, my Kerberos realm is now set to domain1.com, but Profile Manager still insists on using the incoming server name (hostname.domain1.com)as the email address. I tried using both variables, %email% and %short_name%@domain1.com. No luck either way.
What I find aggravating is that if you view the Profile when it is installed, or in Systems Settings > Profiles, the email address is correct. This was also the case before I started over. This leads me to believe that the profiles are somehow not implemented correctly by either Mail or the profile installation process. I looked at the XML in the profile, and do not see any settings that would be responsible for the behavior. Everywhere I used a variable, the resulting values were precisely as I expected.
I again tested the default "Settings for Everyone" profile that is configured automatically based on your server settings, and the Server Admin > Mail > General > "Host name:" setting still takes precedence. So, if you put your actual hostname in this field (i.e. mail.domain.com) your users will all end up using user@mail.domain.com as an address.
I am admitting defeat for now, and just set up A records for domain.com that point to the mail server. This way, I can set my two profiles up, one for each that use domain1.com and domain2.com, respectively, as their incoming servers. The email address will then default to %short_name%@incomingserver
There is a way to do this, but it involves fiddling with DNS to make a 'transparent' software update server. When clients are on your network, their requests to "Apple's" SWU servers go to yours, without any modification of client settings, it truly is transparent.
Check this article out. It's a little old, but this is the general idea that you want to be going with.
In your internal DNS set swquery.apple.com, swcdn.apple.com, and swscan.apple.com as CNAMEs for the server running SUS.
Best Answer
Assuming you want the domains to be synonymous (e.g. richard@domain.com and richard@domain.co.uk both correspond to the same mailbox), it's pretty easy. The trick is that the relevant configuration option is available in Server Admin.app but not Server.app. To get Server Admin, install the server admin tools (v10.7.4 is here, be sure to get the version matching what you're installing on), then open /Applications/Server/Server Admin.
In Server Admin, connect to the server (if it doesn't autoconnect), then select the server name in the sidebar -> Settings in the toolbar -> Services tab -> enable the Mail service and click Save in the bottom right (note: the Save button doesn't highlight very clearly when there are settings that need saving; just get in the habit of clicking it after doing anything).
Once the Mail service is enabled, it should appear in the sidebar (although you may need to click the disclose triangle next to the server name). Select Mail in the sidebar -> Settings in the toolbar -> Advanced tab -> Hosting subtab -> add the additional domain(s) to the "Local Host Aliases" list.
Note: this configures the server to accept mail for additional domain(s). In order for this to do anything useful, you also need to add MX records to DNS for the additional domain(s), so other servers know to deliver the mail to your server.
EDIT: to handle non-synonymous ("virtual") domains, go to Server Admin -> Mail -> Settings -> Advanced -> Hosting, enable virtual hosting, and add the domain(s) to the "Locally Hosted Virtual Domains" list. Then, add aliases to your user accounts for their virtual email addresses. You can add aliases either in Server.app (right-click on a user account and choose Advanced Options), or in Workgroup Manager by adding aliases to the Short Names list.
For example, if you had domain.com as your primary domain, domain.co.uk as a host alias, and otherdomain.co.uk as a virtual domain, and your account was "richard", you would be reachable as richard@domain.com and richard@domain.co.uk, but would have no address at otherdomain.co.uk. If you added "rich@otherdomain.co.uk" as an alias for your account, you'd then also be reachable at that address (but not at rich@domain.com or rich@domain.co.uk).
Note: you can also add aliases in the file /etc/aliases (e.g. add the line "rich@otherdomain.co.uk: richard" to get the effect I described above). If you do this, run
sudo newaliases
and thensudo postfix reload
to get the change to take effect.