Some say that if a melakha did not physically alter an object, like if it was transported from a public domain to a private domain, the item does not become prohibited, and one may benefit from it on Shabbat in the private domain (Rabbeinu Yona and Ritva). The same would apply to food that was transported via motor vehicle on Shabbat; since the food itself underwent no change, it would not be prohibited. However, others maintain that there is no difference between types of melakhot (Tosafot, Ramban, and Rashba). Even if the melakha did not alter the food at all, one may not benefit from it on Shabbat if it was transported in a prohibited fashion. In practice, le-khatĥila it is proper to be stringent, but under pressing circumstances one may rely on those who are lenient, particularly if the melakha was done unknowingly.
If a melakha that was performed on Shabbat enables an additional, permissible action to occur, one may benefit from the permissible action. For example, if a hammer was fixed on Shabbat, it may not be used, even for permitted purposes like cracking nuts. However, if one violated this prohibition and cracked nuts with the hammer, he may benefit from the nuts, since the act of cracking the nuts is not intrinsically forbidden.
If a locked door was unlocked in a forbidden fashion, such as with the use of an electronic key card, some say that one may not enter the room through that opening, since the door was unlocked in a prohibited fashion. Others maintain that one may enter, since unlocking the door did not create anything new; it simply removed an impediment to entering. Be-di’avad, in a time of need, one may be lenient. If a refrigerator door was opened and the refrigerator light went on, one may remove food from the refrigerator (see above, 17:9).
If a Jew who does not observe Shabbat approached an automatic door and thus caused it to open, one may not enter through it. Only under pressing circumstances may one be lenient. If another Jew passed by and unintentionally caused the door to open, one may enter through it (see above, 17:11).
. According to Mor U-ketzi’a, Ma’amar Mordechai, and Nehar Shalom, if a fire was lit on Yom Tov (which is prohibited) and then used to cook food, one may benefit from the food since cooking is not prohibited on Yom Tov (in opposition to Taz 502:1, which forbids). This indicates that one may benefit from a consequence of ma’aseh Shabbat. A key that was transported via a public domain is subject, as we saw in the previous note, to a disagreement about whether one may benefit from a melakha that did not physically alter an object. Under pressing circumstances, one may be lenient. In any case, if the door has already been unlocked with that key, entering through the doorway does not constitute benefiting from the transgression itself, but rather from a consequence. As we said, in such a case one may benefit. This is the opinion of R. Shlomo Zalman Auerbach and R. Yosef Shalom Elyashiv (however, Igrot Moshe, OĤ 2:77 prohibits; see 2:71 as well).
In contrast, if a door was unlocked in a prohibited fashion, such as with an electronic key card, then it would seem that one may not benefit by entering, since the very act of unlocking was done in a prohibited manner. (As we saw, according to Tosafot, Ramban, and Rashba, ma’aseh Shabbat applies to Hotza’ah even though the item is not changed.) This is certainly the position of Igrot Moshe, and it seems to be that of R. Shlomo Zalman Auerbach as well. Nevertheless, according to R. Yosef Shalom Elyashiv (cited in Melakhim Omnayikh, p. 525), it is permissible because opening the door is simply removing an impediment, and this kind of benefit is not prohibited. Furthermore, even without this explanation, we saw above in n. 6 that under pressing circumstances one may rely upon the opinion of Rabbeinu Yona. If a refrigerator door was opened and the refrigerator light went on, even R. Shlomo Zalman Auerbach allows removing food from the refrigerator, since the light was turned on only incidentally (SSK 10:16 and n. 47). For further discussion of all these cases, see Orĥot Shabbat 25:29-32 and §14 in the Birurim section.
If a non-observant Jew opened an electric door by approaching it, one should be stringent and avoid taking advantage of his transgression, as doing so is a desecration of God’s name. However, under pressing circumstances, where there is no choice, one may rely on Rabbeinu Yona (as mentioned above in 17:11 and n. 11).