I recently had the same problem turn up as a secondary issue to our front-load washer not draining water effectively. In the recent few weeks, whenever we would run the washing machine there would be a very foul odor with it. This smell seemed to come from the drain line and not from the drum.
We ordered a new drain pump (#35 in the diagram) and during the installation I checked the drain line (#55 in the diagram) and drain pump trap (#40 in the diagram) and cleaned it out. It was full of foul smelling hair, money, and assorted broken jewelry. I was certain I'd found the source of the bad smell. After getting everything back together and running the machine through a few cycles, we know longer have any bad smells from the machine.
If the smell seems to be coming from the back of the machine near the drain hose, I would encourage you to look into the drain line and pump drain trap. If debris builds up in these places, it creates a breeding ground for mildew and nasty smells. You should be able to find a similar design schematic for your model #; like the one linked above.