Three Australians have died after consuming cantaloupes amid a listeria outbreak that has made at least 11 other people across the country sick in the past seven weeks.

Listeria bacteria, although harmless to most people, pose a severe threat to the elderly, pregnant women and those with serious conditions such as diabetes and cancer.

Most of the cases have been in the state of New South Wales, with others in Queensland and Victoria.

The outbreak has been traced to a melon farm in New South Wales. It has suspended production after authorities informed it of the contamination.

Dr. Vicky Sheppeard from NSW Health urged people to throw away melons bought over the past few days.

"People vulnerable to listeriosis should discard any rockmelon [canteloupe] purchased before 1 March," she said in a statement, adding that all the known cases were "elderly people, and most of them have significant underlying health conditions."

Listeriosis begins with flu-like symptoms that can set in up to six weeks after people consume contaminated produce.

The bacteria can harm the babies of pregnant women even though they themselves do not fall ill.