Keeping Fruit Flies Out of Wine

Summer is here: for winemakers that heralds the inevitable return of our sworn enemy, Drosophila Melanogaster — the common fruit fly. A tiny little flying monkey of doom, it’s hard to exclude them from your winemaking areas, and while easy to kill, by the time you've swatted one, thirteen more have materialized out of thin air, looking for a free meal — females lay 400 eggs each, and they mature in as little as 7 days!
The reason why we need to be concerned over the little monsters isn't just that they're unsightly (and chewy when you discover one in your sip of Chardonnay). No, it's their other name we need to think of, ‘Vinegar Fly'. The little blighters are the vector that turns our delicious wine into vinegar.
Fruit flies feed on microorganisms and yeast, and also plant material and sugary liquids, like sap. To digest this, they have a bunch of gut bacteria that helps break down the sugars into compounds they need, and one of those is acetobacteria, which converts alcohol into acetic acid.
When fruit flies lay eggs on rotting fruit (or in this case, your Chardonnay) they deposit feces on the egg sacs to establish the correct microbial composition in the larvae's guts. Yes, it’s true: not only are they spoiling your wine, they’re pooping in it.
How to combat ‘em? First, understand that they're attracted to the smell of rotting fruit, whose odors include carbon dioxide and alcohol. When they smell it, they expect to find a piece of rotting fruit where they can lay eggs and get a delicious meal. When they smell the carbon dioxide and alcohol gushing out of a fermenting carboy it's their equivalent of spotting a Vegas buffet ten thousand miles long.
Step one in managing these horrific little pests is exclusion. You can't keep them out of your house and your fermenting area, so you'll need to exclude them from the wine itself. Always do covered fermentations. The Big Mouth Bubbler has a tight-fitting lid and a port to plug in an airlock. Keep the wine sealed and airlocked to deny them entry.
Second, when your wine goes to the carboy, make sure you keep that airlock topped up. Some folks use sulfite, and while that's mostly harmless the sulfite usually gases off in a few days into plain water. Other folks want the sanitizing power of alcohol and load the airlock up with grain alcohol. Don’t do it: it will only attract more flies.
Third, wipe up every spill of wine or juice immediately, and wash the area with sulfite to prevent any residue from getting a yeast film going on it. Then make sure you wash your cloths or discard your paper towels in a tightly sealed receptacle-the cloth used to wipe up the juice will become a source of attraction.
Fourth, if you must wash all racked primary fermenters or carboys (those with lees and even a small amount of cloudy wine in them) immediately. If you can't get to the right away, pop the bung and airlock on again.
Fifth, if you filter your wine break down and clean your filter right away, and seal the used pads in a plastic bag before discarding them: they smell dandy to fruit flies.
Sixth, when you're done all the washing, be sure to sluice your drains clean. Wine and yeast residue in the drain trap is not only a new source of food for the flies, it gives them a brilliant place to hide from your cleaning efforts. Run a half-gallon of hot water with your sanitizing solution in it and leave it to sit in the trap for an hour or so and you'll take care of it.
Flypaper only works on fruit flies by accident. Plus, some of the stuff is toxic as all get-out, and not good for winemaking areas. You can set up a wasp trap (available from hardware stores) for them. You could even make your own, pretty simple and easy to make from a plastic soda bottle and some tape
Normally they're filled with fruit juice or other sweet liquid, but that doesn't impress a fruit fly. Fill it with the Magic Formula: apple cider vinegar with a couple of drops of liquid dish soap. The apple cider vinegar drives them to a gustatory frenzy, while the dish soap removes the surface tension of the liquid: when they fly in for a hit and run egg-laying and poop stop, they touch the surface, sink immediately, and drown right away — imagine if you jumped into a lake and had absolutely no buoyancy or resistance to the water. You'd free fall right to the bottom and stay there, unable to surface. Now imagine this as the fate of those awful little flies, ahhhh!
You can also, check out natural pyrethrin-based insecticides: they're made from plant oils, are very safe and can be used in food prep areas. Spray your winemaking area, back out and close the door. Come back in an hour and sweep up the pile of corpses, wipe down the counters and you've knocked them back. It's a wonderful magic trick of insect destruction!

Three things about pyrethrins:

Never use any other kind of insecticide around wine or food prep areas! Triple-check to make sure you've got pyrethrin and not synthetic pyrethroid, which is much more persistent. Pyrethroids are bad for the environment and can be toxic to children and pets, especially cats, who lack the enzyme to break them down, and can rapidly succumb to pyrethroid toxicity. No kitty should be collateral damage to a fruit fly!
You can kill all of the adults, but eggs lurking on a piece of fruit or a tiny patch of spilled wine can hatch and re-start the problem. You'll need to be vigilant and re-apply pyrethrins as necessary.
If you have plant allergies to things such as grass, flowers or ragweed, pyrethrins can trigger them. It's not toxic and doesn't harm humans, but you might sneeze your own head off.
Is All The Fuss Worth It?
It should be noted that cleanly made kit wines that have fully fermented and are sulfited to an appropriate level (follow the instructions) are fairly resistant to colonization by acetobacteria. Sulfite in particular is a perfect inhibitor for it.
But there's always that chance: a missed sulfite addition, a little extra oxygen pick-up in fermentation, one lone fruit fly wings in and . . . well, that's thirty bottles of wine you can't even pour on your salad (wild acetobacter fermentations make a kind of vinegar that tastes mostly like nail-polish remover). Better safe than sorry!