Both men have become ensnared in scandals that could easily have been avoided, had they and their supposed paramours simply remembered the cardinal rule of email. Which is this: write every single one, even your draft emails, as if it were about to be broadcast to the entire nation.

The more of the story that gets uncovered, the more we learn it turned on dumb email practices. Petraeus and his biographer Paula Broadwell, the AP reported Monday, communicated to each other via his personal Gmail drafts folder. Apparently the director of the CIA thought that conducting an affair in draft format was fine, since the message itself would never actually be sent.

That right there is why Petraeus was unfit to lead the world's largest spy network. I've got nothing against Gmail; I love the service and use it all the time. But it is stuffed full of reminders that everything you're writing is being analyzed on servers thousands of miles away. The act of saving a draft, as far as Google is concerned, is indistinguishable from sending it.

Open your Gmail drafts folder, and what's the first thing you see? Ads. Ads specifically tailored to you, based on the content of your emails. You don't see those ads in the draft email itself, but unless you have an ad-blocking plug-in, you should have seen enough uncanny targeted messages on the way there to shock you into sober, reflective, professional writing.

The clandestine act of sharing drafts, ironically enough, was what brought the whole thing to light. If Petraeus had just sent steamy messages to Broadwell in the clear, he would have been even more reckless, but the affair might never have been discovered. It's the fact that Broadwell's IP address was logging into an account also used by the CIA director that panicked the FBI. Understandably, agents were afraid of the consequences if the nation's spy chief had been hacked.

Then there's Broadwell herself, whose allegedly threatening emails to Petraeus friend Jill Kelley were what caused Kelley to summon the FBI (via its now-infamous agent who sent Kelley pictures of himself shirtless) in the first place.

No one knows what those Broadwell emails contained, but a source at the "highest levels of the intelligence community" told the Daily Beast that the emails were "cat-fight stuff ... like 'Who do you think you are? … You parade around the base … You need to take it down a notch.'"

Broadwell probably thought she was being clever. The emails were from an anonymous Gmail account. They contained no overt threats. Still, all it took to uncover her as the sender was one FBI subpoena. Legal pro tip: if the Feds wait 180 days after the emails are sent, they don't need a warrant. With Gmail, the content is always there, accessible from anywhere — that's kind of the idea.

General Allen, head of US forces in Afghanistan, has also learned to his chagrin just how easy it is for law enforcement to get hold of your email. He and Kelley exchanged some 20,000 pages worth of them in a two-year period, the Feds learned.

Although the Allen-Kelley emails aren't said to have gone much further than flirtation, they are at best an embarrassment, and at worst a dereliction of duty.

To put the amount of emails they shared in context, that private Hotmail account former Alaska Governor Sarah Palin was forced to turn over to her investigators ran 24,000 pages in total. And Palin was effectively (or ineffectively, depending on your point of view) running a state for two years on that account.

Allen is supposed to be running an entire war. And he had time to trade tons of flirtatious missives with a liaison back home, to an extent that makes Lord of the Rings look like a pamphlet? It's the volume, rather than the content, that may not sit well with the Pentagon investigators now probing Allen's communications.

It's possible that we're dealing with a generation of leaders who are overenthusiastic and ill-informed about email precisely because they didn't grow up with it. Petraeus just turned 60; Allen is 58. (Broadwell, at 40, has no such generational excuse). It's also possible that the potential for being found out was part of the thrill. And hey, at least they weren't accidentally tweeting pictures of their underwear to each other.

But regardless of the reason, the Petraeus and Allen affair should be a warning to all of us — and a godsend to IT departments looking to chasten their executives over their email usage.

If you're going to conduct an ill-advised affair, or cat-fight with a potential rival, then at least have the smarts to not do it on an insecure, wildly popular, advertising-filled free email service.

Mashable
is a global, multi-platform media and entertainment company. Powered by its own proprietary technology, Mashable is the go-to source for tech, digital culture and entertainment content for its dedicated and influential audience around the globe.