When you get an email notification of a personal message its footer contains a link like http://moodle.org/message/index.php?id=1231591 The id is the person who sent you the message. Your ID is assumed. The problem is that if you're not logged in and you click on the link and youre server has auto-login as guest turned on you wind up being redirected to the site's front page. The URL needs to contain your ID as well. This functionality already exists in index.php. The appropriate parameter should hopefully just need to be included in the URL.