I've just noticed that Zimbra OpenSource Edition version 5.0.5 overwrites the chosen From-address (identity) with the canonical address even if the user is allowed to manage identities and is allowed to use _any_ From-address (both set in the user's account settings). Previous Zimbra versions always kept the chosen From-address.
The behavior is a bit more complex than described above. There are circumstances where Zimbra leaves the From-address untouched: When it belongs to a domain that is not managed by Zimbra.
Account ID: uid@domainA.com
Canonical Address: first.last@domainA.com
Identity: A (for domainA: first.last@domainA.com)
Identity: B (for domainB: first.last@domainB.com)
Identity: C (for external domain, e.g.: firstname.lastname@example.org)
When I choose identity A, Zimbra sets first.last@domainA.com (of course).
When I choose identity B, Zimbra sets first.last@domainA.com (the canonical address and unfortunately not identity B!).
When I choose identity C, Zimbra accepts identity C with email email@example.com and does not enforce the canonical address.
The behavior is reproducible with Thunderbird and also with the Zimbra Webclient.
Is this behavior really intended or is it a bug? My script sets the canonical address for every newly created user because I want to prohibit that the email address uid@domainA.com is ever shown to the outside world (which would be the default from address even if there are some aliases).