ubuntu/debian support, php mail mock and other minor changes