Researchers of a study published in the March 28 May 11, 2007 issue of Neuroscience discovered that injections of a soil bacterium, Mycobacterium vaccae, increased the activity of serotonin-producing neurons in mice. (The paper is titled "Identification of an Immune-Responsive Mesolimbocortical Serotonergic System: Potential Role in Regulation of Emotional Behavior.")
Lowry and his colleagues studied another set of mice, who were subjected to a stress-response test. They dropped each mouse into water for five minutes and timed how long it would take the animal to switch from active swimming to passive floating. Control mice swam for an average of two and a half minutes, while the M. vaccae–injected animals paddled for four. Researchers already know that antidepressants increase active swimming and decrease immobility. The bacteria "had the exact same effect as antidepressant drugs," Lowry explains.
The results so far suggest that simply inhaling M. vaccae–you get a dose just by taking a walk in the wild or rooting around in the garden–could help elicit a jolly state of mind. "You can also ingest mycobacteria either through water sources or through eating plants–lettuce that you pick from the garden, or carrots," Lowry says.
Maybe this explains some people's craving for eating dirt? From a CDC article titled "Eating Dirt":
Among children, too, it seems eating dirt might have immunologic consequences. Maternal immunoglobulins are secreted in breast milk shortly before birth and for 1 year or more afterwards. Children often begin eating dirt a year or two after birth. As maternal immunity wanes, eating dirt might "vaccinate" children who are losing their maternal IgA, which could stimulate production of nascent immunoglobulins, especially IgA. Eating dirt might also help populate intestinal flora.