Log messages should be associated with resources, not with hardcoded mailoutId and messageId.
Fix some compile warnings.
Cache .ico files like other images.