How to read a user's /var/mail/ file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
spacebizall
Forum Newbie
Posts: 1
Joined: Thu Dec 31, 2009 2:29 pm

How to read a user's /var/mail/ file?

Post by spacebizall »

I am trying to write a script that takes a username (corresponding with a user on the server) and then reads the appropriate /var/mail file for that user and prints it.

I've already tried something like

Code: Select all

 
<?php
$username = $_POST["username"];
$output = shell_exec("cat /usr/mail/$username");
echo $output;
?>
 
but it returns a blank page with only a "4" printed.
Post Reply