hgetall("imail:msg:$id"); if (!$meta || $meta['recipient'] !== $user) { die("Message not found or not yours."); } $body = file_get_contents($meta['file']); $plain = decryptMessage($body, $meta['encryption'], $password); // Mark as read $redis->hset("imail:msg:$id", "status", "read"); echo "

From: {$meta['sender']}

"; echo "

Subject: {$meta['subject']}

"; echo "
" . htmlspecialchars($plain) . "
";