General solution of Pauli master equation and applications to diffusive transport