Rep. Anthony Weiner overconfidently sent emails -- to his porn star pal Ginger Lee, no less -- mocking former Senator Larry Craig's bathroom sex scandal ... just 2 weeks before Weinergate exploded.
In the May 12 email exchange -- obtained by TMZ -- Weiner warned Lee a "conservative blogger/troll" is trying to contact his female Twitter followers to do a story about them.
Lee responded by saying, "If you're sleeping with your Twitter followers, that would make for a way cooler headline than if you were trollin' for folks in the bathroom at an airport or something of that nature."
Weiner apparently thought the clear and direct shot at Craig's 2007 airport bathroom sex scandal was hysterical -- he responded with, "yeah, the joke's on me. some of my twitter followers hang out in airport bathrooms apparently. thats where trolls troll."
Weiner may not find the reference so funny anymore -- but he can't deny the irony.
The emails also reveal that although Weiner knew someone -- the "conservative blogger/troll" -- was tracking his social networking ... he still sent the undies pic that brought the glass house crashing in on him.