If a fire breaks out on Shabbat, the first question that must be addressed is whether it presents a danger to human life. If it does, there is a mitzva to do whatever is necessary to extinguish it. However, if it is clear that there is no danger to human life, then even if the fire may cause extensive property damage, as is the case when an entire house goes up in flames, one may not put it out, because monetary loss does not override Shabbat.
Furthermore, the Sages prohibited moving items from a burning house to the street or courtyard even when there is an eruv. Their concern was that people might be so panicked about saving their property that they may either put out the fire or carry objects from a private domain to a public domain, thereby violating the melakha of Hotza’ah. Only food, clothing, and receptacles/implements needed for that Shabbat may be removed from a burning home (assuming it is within the eruv). If there is a large receptacle in the home, one may fill it with food even if it is more than will be needed for that Shabbat, as long as it can be carried out of the home in one trip. The same principle applies to clothing: as long as one is wearing them as he leaves the house, he may save many items of clothing, even more than are necessary for that Shabbat. This prohibition only applies to moving things into a shared courtyard; but one may salvage any quantity of food and non-muktzeh objects into a private yard where an eruv is not required, or into another apartment in the same building where there is an eruv (SA 334:11, MB ad loc. 28).
Just as a homeowner may save items that he needs for Shabbat, he may also tell his neighbors that they can take whatever they need. Each neighbor can then take food for himself for Shabbat and put on as many items of clothing as he can. After Shabbat, the custom of the pious is to return the salvaged clothing and items to the original owner (SA 334:9; SSK 41:3-13).
The poskim disagree about whether one may salvage money and valuables that are not necessary for Shabbat from a burning building. One who is lenient has an opinion on which to rely. However, this is all on condition that he not transgress a Torah prohibition. If, in order to salvage his money, he would need to carry it from a private domain to a public domain, thus violating Torah law, he may not do so. However, he may carry the money out with a shinui, as this is only rabbinically prohibited (SA 334:2; Taz; see MB ad loc. 4-5, SHT ad loc. 3, and BHL s.v. “ve-yesh”).
Residents of neighboring buildings may remove everything they own from their homes. As long as the fire has not yet spread to their homes, we can assume that they are not so panicked, and so we are not worried that they will end up putting out the fire (SA 334:1).
Although a Jew may not extinguish the fire, he may hint to a non-Jew to do so. For example, he may say: “Whoever extinguishes this fire will not lose out.” Or he could call to the non-Jew urgently and tell him that a fire has broken out and that it is forbidden for a Jew to put it out. The non-Jew will then figure out on his own that the Jew wants him to put out the fire, and perhaps will even pay him for doing so (SA 334:26).
Similarly, one may indirectly cause the fire to go out, since according to Torah law it is only acting directly that is forbidden. Normally the Sages forbid causing melakha to be done indirectly, but in a case of loss, grama is permitted. Therefore, if one side of a cabinet catches fire, one may cover the other side with wet rags so that the fire will go out when it reaches them. Similarly, one may place bags full of water on a spot where the fire has not yet reached, so that they will burst open and extinguish the fire when it reaches them (SA 334:22). One may also pour water on a spot that is not burning, as long as it is far enough away from the fire that the water will only reach the fire and begin extinguishing it after a while (See SA 334:24; SSK 41:16).
. According to Rambam and those who follow his approach, who maintain that performing a melakha she-eina tzerikha le-gufah is prohibited by Torah law, it is clear that there is no way to permit putting out a fire to save one’s possessions. It is also obvious why the Sages ordained that one may not save more than what is necessary for Shabbat. However, according to most poskim, who maintain that a melakha she-eina tzerikha le-gufah is only rabbinically prohibited, why does this rabbinic prohibition apply even in a case where following it would lead to a massive loss? After all, the Sages permitted stamping on the grass clogging up a pipe in order to prevent a loss (Ketubot 60a; SA 336:9). Even though many maintain that fixing the pipe would be prohibited by Torah law, the Sages permitted fixing it with a shinui to prevent a loss (Livyat Ĥen §103). Similarly, they were lenient in allowing one to carry valuable possessions into a public thoroughfare with a shinui to prevent their possible theft (Rema 301:33). Some even permit moving muktzeh objects in order to save possessions from fire or theft (SA 334:2). So why didn’t the Sages allow one to put out a fire in order to save all of his possessions?It would seem that the answer is that, as Ran writes (on Rif, 61a, s.v. “u-vimkom”), a melakha she-eina tzerikha le-gufah is more severe than other rabbinic prohibitions. Ran suggests that since performing a melakha she-eina tzerikha le-gufah looks the same as performing an act prohibited by Torah law, and only the intent differs, the Sages were concerned that people would be unable to distinguish between the two and would end up being lenient even with Torah prohibitions. Therefore, the Sages forbade putting out a fire even in the case of a melakha she-eina tzerikha le-gufah. A similar approach appears in Ĥayei Adam 46:1 and BHL §278 at the end of s.v. “mutar.” (A parallel idea appears in the laws of bein ha-shmashot, as explained in MB 342:1.) It also may be that because having a fire in one’s home can make one extremely distressed, one who is worried about his possessions might perform several melakhot in his distressed state. Because of this, the Sages felt a need to reinforce the observance of the melakhot and did not permit even rabbinic transgressions. They allowed rescuing possessions only under very limited circumstances, so as to eliminate the concern that it would cause people to transgress other prohibitions as well.
R. Shlomo Zalman Auerbach, cited in SSK ch. 41 n. 8, wonders why we do not seem to be concerned about the emotional state of the homeowner and his family, who might lose their minds upon seeing their home and possessions going up in flames. In fact, it is possible for one to die or to go insane as a result of this kind of trauma. Elsewhere in SSK (ch. 32 n. 83), R. Auerbach points out that some allow the transgression of Torah prohibitions to protect one’s mental and emotional health. In practice it would seem that when there is a real possibility of a family member experiencing psychological trauma, the fire may be extinguished, but when there is no such concern, even if tremendous suffering is involved, one may not extinguish the fire.