Motivated by empirical evidence and economic arguments, we assume that the cash reservoir of a financial corporation follows a mean reverting process. The firm must decide the optimal dividend strategy, which consists of the optimal times and the optimal amounts to pay as dividends. We model this as a stochastic impulse control problem, and succeed in finding an analytical solution. We also find a formula for the expected time between dividend payments. A crucial and surprising economic result of our paper is that, as the dividend tax rate decreases, it is optimal for the shareholders to receive smaller but more frequent dividend payments. This results in a reduction of the probability of default of the firm.