modified lostkey function ,sendemail from daemon