Use correct permissions when writing mail