added mail export cleanup