fixes for mail system.