public function getCharacterMailTimeline(int $message_id = null)
    {

        // Get the User for permissions and affiliation
        // checks
        $user = auth()->user();
        $messages = MailHeader::with('recipients', 'body');

        // If a user is not a super user, only return their own mail and those
        // which they are affiliated to to receive.
        if (! $user->hasSuperUser()) {

            $messages = $messages->where(function ($query) use ($user) {

                // If the user has any affiliations and can
                // list those characters, add them
                if ($user->has('character.mail', false))
                    $query = $query->whereIn('character_id', array_keys($user->getAffiliationMap()['char']));

                // Add mail owned by *this* character
                $query->orWhere('character_id', $user->id);
            });
        }

        // Filter by messageID if its set
        if (! is_null($message_id))
            return $messages->where('mail_id', $message_id)
                ->first();

        return $messages->orderBy('timestamp', 'desc')
            ->groupBy('mail_id')
            ->paginate(25);
    }