The Shulchan Aruch · Yoreh De'ah
יורה דעה שע״זYoreh De'ah 377
Siman 377 of 402 in Yoreh De'ah — 3 se'ifim
הלכות אבילותMourning· siman 377
Se’if 1א׳
הָעֲבָדִים וְהַשְּׁפָחוֹת, אֵין עוֹמְדִין עֲלֵיהֶם בְּשׁוּרָה, וְאֵין אוֹמְרִים עֲלֵיהֶם תַּנְחוּמֵי אֲבֵלִים, אֶלָא אוֹמְרִים לוֹ: הַמָּקוֹם יְמַלֵא חֶסְרוֹנְךָ, כְּשֵׁם שֶׁאוֹמְרִים לְאָדָם עַל שׁוֹרוֹ וַחֲמוֹרוֹ.
For male and female slaves no line [of comforters] is made, nor is consolation offered [to their master], but they say to him, 'May the Lord replace your loss,' even as they say to a man regarding his ox and his ass, ['May the Lord replace your loss'].1Ber. 16b. Nowadays this law does not apply since we do not own slaves.
Se’if 2ב׳
אָבֵל מְנֻדֶּה, אֵין מַבְרִין אוֹתוֹ וְאֵין אוֹמְרִים לוֹ תַּנְחוּמֵי אֲבֵלִים.
A mourner who is an excommunicant must not be provided with the mourner's meal,2 infra § 378. nor is consolation offered to him.3Tur on the authority of T.H. because it is forbidden for one to be in his four cubits. Anything that brings honour to the living is not done for an excommunicant — ShaK. Cf. supra § 345, 4.
Se’if 3ג׳
מְנֻדֶּה שֶׁמֵּת, מְנַחֲמִים אֲבֵלָיו.
[If] an excommunicant died, his mourners may be offered consolation.4T.H. Cf. supra § 345, 1.
Shulchan Aruch, Yoreh De'ah — Torat Emet 357 edition, via Sefaria — public domain
English: Code of Hebrew Law, tr. Chaim N. Denburg, Montreal 1955 — CC BY