fixes for mail system