Sewer flies, also known as drain flies, enter the house through open windows and doors and reproduce in drains and stagnant water. To get rid of them you need clear plastic cups, cooking spray, a long-handled brush and drain cleaner.
Locate sewer fly infestation
To determine the drains the flies are breeding in, coat the inside of clear plastic cups with cooking spray, and use them to cover all the household drains overnight. You should find some flies stuck to the spray over infested drains.
Clean infested drains
Use a stiff-bristled brush and a biodegradable cleaner to thoroughly scrub the infected drains. Remove sink traps, and scrub them as well. An alternative to drain cleaner is a mixture of one cup baking soda, 1/2 cup salt and 1/2 cup vinegar. When you have finished and reassembled the pipes, flush the drain liberally with boiling hot water. Also, scrub out the flush tanks of toilets you don't use often.
Eliminate filth and standing water
Sewer flies are drawn to filth and standing water. To keep them away, search for and dispose of standing water and moist environments in your home, such as leaking pipes, broken air conditioners, drip pans under appliances and stagnant water in plant pots. Clean and disinfect your garbage disposal and kitchen garbage bin. Also, be sure the garbage bin top closes snugly.