When any person is designated as executor in a will, or has been appointed as executor, and defends or prosecutes any proceedings in good faith and with just cause, whether successful or not, that person shall be allowed out of the estate necessary expenses and disbursements, including reasonable attorney fees in such proceedings.