I would not fill it with foam. My understanding is the foam holds water, and makes the problem worse.
This might be an old wives tale, and am sure that someone here can say yeah or nay, but an old bodyman I knew did a ground up restoration on an old mustang. Us used to take old motor old and spray the frame and some internal parts of the body. He;d let it set for a day or two. Swore it prevent rust better than anything else.