Cabbage and houseflies

I have always heard cooking cabbage attracts houseflies. It seems that most people can remember their mothers or grandmothers cooking a mess o’ cabbage, and there being a mess o’ flies congregating on the screen door, or in the house if the door was open. What causes this?

Um, they’re attracted to the smell?

Yeah, I guess. But that answer is a little too general for my taste. I mean, is there a chemical compound in the cabbage that attracts them? If so, what is it? And, since flies are ordinarily buzzing around all things icky – dead bodies of all kinds, garbage, animal poop, etc. – the attraction to boiling cabbage is particularly peculiar. So, I guess I’m looking for a scientific answer.

This is just a guess but by this link There is a class of chemical compounds in cabbage leaves that attract cabbage root flies. Maybe there’s some overlap. I’m not an entomologist, I just Googled for: diptera pheromone cabbage.