GFI mailessentials Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I was getting this message when I tried to view the details of a message in the spam quarantine.
Turns out that the account ASPnet did not have permissions on the quarantine folder.