Being Dublin painter decorators; we have come across this problem many times on houses over the years, where builders or carpenters when building or restoring windows have used non galvanised nails on the exterior of a house, really not a good idea, so what to do?
We are assuming from the off set that replacing all the nails in the woodwork is not an option. So, after this there are a few ways of preventing the stains form reappearing. The amount of time and effort that each of these repair methods adds to the overall paint job varies greatly, but the more thorough (and time-consuming) your approach, the longer lasting your results will be.
So before you start painting your wood work the standard sanding down and removal of loose material is necessary, while one dose this you lightly sand over each brown stain. Then apply several coats of a stain blocking primer/sealer with a rust inhibitor such as Zinister cover stain primer or rustins rust primer, at least two coats should be applied to each and every stain. It is recommended that one primes about an inch around each stain.
A more extensive approach is to expose each nail head before priming, this process will probably get a few more years out of your final paint job. After uncovering the nail heads, remove the rust as best you can by scraping, sanding or wire-brushing, and spot-prime each nail head immediately with the same primer described above.
Yet another option that may be worth the time and expense, especially if you are doing the job yourself, is exposing each nail head, removing the rust and then sinking each nail into the woodwork about 1/8″. Apply primer over each nail, and fill each hole with a quality wood filler “Ronseal epoxy wood filler”. After the holes are filled, spot-prime each area with a high-quality oil or latex primer before applying the finish paint. This is very time consuming but short of replacing all nails this is the best option.