A woman who is facing the bathroom may recite sacred words and pray as the door is closed and no foul odor reaches her. If the door is open, she may not pray there. However, if her back or side is turned towards the bathroom, as long as no foul smell reaches her, she may pray and recite sacred words (SA 83:1; MB 83:5).
Occasionally, a sewer emits a stench into a nearby home or synagogue. In such a case, it is forbidden to pray inside. Sometimes closing the windows that face the sewer helps, and if the odor lingers, air freshener can be used to eliminate it. In the past, people would eliminate a stench by burning a garment (Kaf Ha-ĥayim 79:20).
The status of a particular smell depends on accepted local norms. In the past, sewage, including feces and urine, would flow alongside streets, and the air in crowded cities was full of foul odors. Even so, prayers would be recited in synagogues and houses near the sewage canals because everyone was accustomed to them and did not consider them foul. Only on summer days or when the sewage canals were clogged would the stench intensify to the point that people would not pray nearby (see MB 79:5). Nowadays, however, sewage is drained, the air is purer, and we are more sensitive to bad smells; hence, wherever we sense a foul odor by today’s standards, it is forbidden to pray.
Similarly, in farming communities, the smell from the barns and chicken coops that regularly reaches homes and synagogues is not considered by the local residents to be a bad smell. The same smell in the city may be considered foul, and it is prohibited to pray as long as it persists. Those who are guests in communities like these should follow the local custom.
People who pray outside must be careful not to pray in close proximity to garbage bins that smell bad. Even when the garbage cans do not emit a foul odor, it is proper not to pray within four amot of them or facing them.