Date: 12 Shevat 5578
From: Rabbi Moshe Sofer
To: Unknown recipient
The Chasam Sofer permits a notorious promiscuous woman to marry while pregnant, despite the rabbinic prohibition against marrying a meubberes chaveiro, because the same takanah that prohibits such marriage to protect the child mandates it when the child's spiritual survival is at stake — here, the child would otherwise be handed to a Christian foundling home. He rejects apostasy threats as grounds for leniency but validates the permission through the Bach's principle that a lesser transgression may be permitted to save the public from widespread sin caused by ongoing temptation. He conditions the ruling on financial collateral for the child's nursing, appointment of a guardian, and a requirement that the child not be raised under the presumption of being the husband's biological son.
Source: Shu"t Chasam Sofer EH I §36