The pilot was flying at 1500 feet above ground level with the fuel selector set for the right fuel tank when the engine stopped. The right fuel gauge was reading near empty but the reading was fluctuating due to gusty inflight weather conditions. The left tank had already been run dry in an effort to achieve maximum endurance. Based on past fuel burn off rates and elapse time since the last refuel, the pilot believed that his 45 minute fixed reserve was still available despite the low fuel gauge reading. When the engine stopped the pilot selected the boost pump on. The engine restarted for a few seconds before stopping again. He turned the aircraft to the most suitable paddocks where he became committed to a downwind forced landing. During the landing roll the right flap was damaged by a steel fence post. After the landing the pilot saw fuel stains on the left wing near the fuel cap. Fuel had vented overboard in flight past a faulty fuel cap seal.