Fix handling of uuencoded messages if messages_cache is enabled (#1490108)