Added semaphore to crappy getRawMail code