mailwrapper and BSD compatibilty functions