Lucky for John Kerry that no one has ever been convicted (or even prosecuted since 1852) for violating the 18th-century Logan Act, which bars private diplomacy against US interests.

Because what the former secretary of state has been doing to pressure President Trump against withdrawing from the Iran deal sure looks like a textbook violation.

The Boston Globe reports that Kerry in recent weeks has engaged in “unusual shadow diplomacy” to “apply pressure on the Trump administration from the outside,” holding meetings and phone calls “below the radar” with Iranian and European leaders.

Kerry doesn’t deny the meetings, but claims he’s only been “urging Iran to remain in compliance” to ensure the disastrous deal negotiated on his watch “remains effective.”

We have our doubts: Just a few weeks ago, in fact, he reportedly was urging Palestinian Authority officials to “stay strong and play for time” in hopes Trump will be removed from office.

In neither instance was Kerry representing the US government. On the contrary, he seems to have been doing precisely what the Logan Act expressly forbids: acting “without authority” and communicating with foreign governments “to defeat the measures of the United States.”

This doesn’t mean Kerry should be prosecuted, no matter how despicable his behavior — because, again, the law is a dead letter.

Not that that stopped the shrill calls for a Logan Act indictment of Gen. Mike Flynn for his post-election contacts with Russian officials, even though he was acting for an incoming president.

At any rate, it’s unlikely anything John Kerry’s done could influence Trump’s nuke-deal decision. We’ll find out for sure at 2 p.m. Tuesday, when the president says he’ll make his intentions known.