We conduct a theoretical investigation into whether changes in the outgoing longwave radiation (OLR) spectrum can be used to constrain longwave greenhouse-gas forcing and climate feedbacks, with a focus on isolating and quantifying their contributions to the total OLR change in all-sky conditions. First, we numerically compute the spectral signals of CO2 forcing and feedbacks of temperature, water vapor, and cloud. Then, we investigate whether we can separate these signals from the total change in the OLR spectrum through an optimal detection method. Uncertainty in optimal detection arises from the uncertainty in the shape of the spectral fingerprints, the natural variability of the OLR spectrum, and a nonlinearity effect due to the cross-correlation of different climate responses. We find that the uncertainties in optimally detected greenhouse-gas forcing, water vapor, and temperature feedbacks are substantially less than their overall magnitudes in a double-CO2 experiment, and thus the detection results are robust. The accuracy in surface temperature and cloud feedbacks, however, is limited by the ambiguity in their fingerprints. Combining ambiguous feedback signals reduces the uncertainty in the combined signal. Auxiliary data are required to fully resolve the difficulty.