The horny harbormaster who cut a wide swath through the town of Huntington – and is suing one of his alleged conquests for sexual harassment – can kiss his marriage goodbye.

William Perks claims he enjoyed a steamy affair with a married town councilwoman who then made his working life miserable after he dumped her. Now he is getting the boot from his estranged wife, The Post has learned.

A source says Teresa Gregory, currently separated from Perks, has informed him she plans to begin divorce proceedings, in part because of the “ongoing saga of six years that put such a strain on her marriage.”

“There’s an intention to make it permanent at this time,” said the source about Gregory, who’s the filthy-rich ex-wife of Lehman Brothers’ CEO.

Perks’ lawyer Ed Yule said he’s not aware of any matrimonial papers being served as yet, but refused to comment further.

According to court papers, Perks was having sex with at least four other women around the same time he was allegedly seeing ex-councilwoman Susan Scarpati-Reilly, whom he later dumped to get serious with Gregory.

The women included his future wife, his lawyer’s secretary, another town of Huntington official who was Perks’ superior, and a fourth woman. When a Post reporter yesterday approached the town employee Perks is said to have bedded, she would neither confirm nor deny the tryst.

Yule would not discuss his secretary’s alleged bedroom antics with Perks, but a source close to Perks said: “Single people have the right to date anyone they want.”

Perks, 53, is seeking $12 million in damages from Scarpati-Reilly, 53.

The ex-harbormaster claims she had him demoted to cleaning toilets and ultimately out of his job after he ended their affair, a relationship she has repeatedly denied.

After Perks started wining and dining Gregory, he dropped Scarpati-Reilly to “trade up” and wed the wealthy divorcée, who received as much as $50 million in her 1999 divorce settlement, and move into her Long Island Gold Coast mansion.