The primary cause of the bad smell in a front-loading washer is the rubber gasket that prevents water from leaking onto the floor, according to About.com. This gasket prevents air circulation, collects residue from soap and fabric softener, and provides a breeding ground for mold and mildew.
Leaving the door unlatched and slightly ajar increases the air circulation into the machine. This air circulation allows water to evaporate from the gasket, replaces the bad-smelling air with fresh air from outside the machine and inhibits mold growth.
The products used with top-loading washing machines to ensure fresh-smelling laundry are part of the problem with high-efficiency front loaders. Front-loading machines reduce water usage and are less likely to rinse away excess detergent and fabric softener from the gasket. Detergents that produce excess suds in the machine are more likely to leave residue that does not rinse away. The solution, reports About.com is to switch to HE detergents and use the manufacturer's recommended amount for each load.
Reducing or eliminating the use of fabric softener in the wash also helps keep odors out of the machine. For a natural fabric softener that does not build up on the gasket, DIY Natural recommends premixing vinegar with 30 to 40 drops of a favorite essential oil and adding 1/4 cup of the mix to the fabric softener dispenser for each load.