Exchange 2007 Error: Microsoft.Exchange.Data.Storage.StoragePermanentException

I got the following error whilst trying to log into a user’s mailbox via Outlook Web Access:

Request
 Url: https://mail.domain.local:443/owa/lang.owa
 User host address: 123.123.123.123
Exception
 Exception type: Microsoft.Exchange.Data.Storage.StoragePermanentException
 Exception message: There was a problem accessing Active Directory.
Call stack
Microsoft.Exchange.Data.Storage.ExchangePrincipal.Save()
 Microsoft.Exchange.Clients.Owa.Core.RequestDispatcher.DispatchLanguagePostLocally(OwaContext owaContext, OwaIdentity logonIdentity, CultureInfo culture, String timeZoneKeyName, Boolean isOptimized)
 Microsoft.Exchange.Clients.Owa.Core.RequestDispatcher.DispatchLanguagePostRequest(OwaContext owaContext)
 Microsoft.Exchange.Clients.Owa.Core.RequestDispatcher.PrepareRequestWithoutSession(OwaContext owaContext, UserContextCookie userContextCookie)
 Microsoft.Exchange.Clients.Owa.Core.RequestDispatcher.InternalDispatchRequest(OwaContext owaContext)
 Microsoft.Exchange.Clients.Owa.Core.RequestDispatcher.DispatchRequest(OwaContext owaContext)
 System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Inner Exception
 Exception type: Microsoft.Exchange.Data.Directory.InvalidADObjectOperationException
 Exception message: Property Languages cannot be set on this object because it requires the object to have version 0.1 (8.0.535.0) or later. Current version of the object is 0.0 (6.5.6500.0).
Call stack
Microsoft.Exchange.Data.Directory.PropertyBag.set_Item(PropertyDefinition key, Object value)
 Microsoft.Exchange.Data.Directory.ADObject.set_Item(PropertyDefinition propertyDefinition, Object value)
 Microsoft.Exchange.Data.Directory.ADObject.StampCachedCaculatedProperties(Boolean retireCachedValue)
 Microsoft.Exchange.Data.Directory.ADObject.ValidateWrite(List`1 errors)
 Microsoft.Exchange.Data.Directory.Recipient.ADRecipient.ValidateWrite(List`1 errors)
 Microsoft.Exchange.Data.Directory.Recipient.ADUser.ValidateWrite(List`1 errors)
 Microsoft.Exchange.Data.Directory.ADSession.Save(ADObject instanceToSave, IEnumerable`1 properties)
 Microsoft.Exchange.Data.Storage.ExchangePrincipal.Save()

Turns out a mailbox attribute version was wrong:

Exchange Server 2007 and Exchange Server 2010 both use the msExchVersion attribute to determine the version of Exchange Server with which user objects are associated. If the version value is less than 0.1, Exchange Server 2007 or Exchange Server 2010 considers the user object as Read-only.

Find out the attribute version by running:
Get-Mailbox [username] | format-list ExchangeVersion

And fix by running:
Set-Mailbox [username] -ApplyMandatoryProperties

Find out more here: http://support.microsoft.com/kb/941146