One only recites a blessing over spices made for the purpose of smelling, namely spices in a shop or in a house made for a good scent. However, if they placed the spices to remove a bad odor or filth, such as spices placed near a beit hakise to remove the stench, or spices placed above the bed of a deceased person and the like—one does not recite a blessing over them, for they are not made for a good scent but rather to remove the bad odor. Similarly, spices at a gathering of idolaters, for their general intent is for their service—they are prohibited for benefit, and the details of this law were explained in siman 217, see there. And if one recited a blessing over any of these—he has not fulfilled his obligation, and his blessing is close to being in vain, even though he smelled a good scent from them, because they are not for a good scent but to remove the bad, and the good comes on its own. Therefore, he must go back and recite a blessing over other spices if they are prepared in his house, and there is no concern here of a blessing that is not needed, for he is always permitted to recite a blessing over other spices and not because of Motzaei Shabbat, and certainly on Motzaei Shabbat. Similarly, over the spices of a woman prohibited to him, such as those hanging on her neck or her hand, even though they are made for smelling—one does not recite a blessing, lest he come from this to a state of familiarity, as I wrote there. And in this case, it appears that post facto he does not need to go back and recite a blessing, since it is only because of a decree. Similarly, spices made to remove perspiration—one does not recite a blessing, and similarly over incense with which they perfume vessels or one who smells perfumed vessels—it is a blessing in vain, and he goes back and recites a blessing, and see there in siman 217 for the details of the laws regarding this. And one does not recite a blessing over a vessel in which they crush spices even though it smells, for the scent is produced on its own and was not made for smelling (Taz ibid. at the end of subsection 2), and similarly over any scent that has no substance—one does not recite a blessing over them, as I wrote there.
אין מברכין אלא על בשמים העשוי כדי להריח, והיינו בשמים שבחנות ושבבית העשוי לריח טוב. אבל אם העמידו הבשמים להעביר ריח רע או זוהמא, כגון בשמים שהעמידו אצל בית הכסא כדי שיעביר הסרחון או בשמים שהעמידו למעלה ממטתו של מת וכיוצא באלו - אין מברכין עליהם, שאין עשויים לריח טוב אלא להעביר הריח הרע. וכן בשמים שבמסיבת עובדי כוכבים, שסתם כוונתן לעבודתם - הוה איסורי הנאה, ופרטי דין זה נתבאר בסימן רי"ז ע"ש. ואם בירך על אחד מכל אלו - לא יצא, וברכתו קרוב לבטלה, אף על פי שהריח מהם ריח טוב, לפי שאינן לריח טוב אלא להעביר הרע, והטוב ממילא אתי. ולכן צריך לחזור ולברך על בשמים אחרים אם יש מוכנים בביתו, ואין כאן חשש ברכה שאינה צריכה, שהרי רשאי תמיד לברך על בשמים אחרים ולא בשביל מוצאי שבת, וכל שכן במוצאי שבת. וכן על בשמים של ערוה, כגון התלוי בצוארה או בידה, אף על פי שעשוי להריח - אין מברכין, שמא יבא מזה לידי הרגל דבר כמ"ש שם. ובזה נראה דבדיעבד אין צריך לחזור ולברך, כיון שהוא רק משום גזירה. וכן בשמים העשוי להעביר הזיעה - אין מברכים, וכן על מוגמר שמגמרים בו את הכלים או המריח בכלים מוגמרים - הוה ברכה לבטלה, וחוזר ומברך, וע"ש בסימן רי"ז פרטי דינים בזה. ואין מברכין מכלי שדוכין בה בשמים אף על פי שמריח, דהריח נעשה ממילא ולא נעשה להריח (ט"ז שם ססק"ב), וכן בכל ריח שאין לו עיקר - אין מברכין עליהם, כמ"ש שם.