We study a carrier-synchronization scheme for coherent optical communications that uses a feedforward architecture that can be implemented in digital hardware without a phase-locked loop. We derive the equations for maximum a posteriori joint detection of the transmitted symbols and the carrier phase. The result is a multidimensional optimization problem that we approximate with a two-stage iterative algorithm: The first stage is a symbol-by-symbol soft detector of the carrier phase, and the second stage is a hard-decision phase estimator that uses prior and subsequent soft-phase decisions to obtain a mimimum mean-square-error phase estimate by exploiting the temporal correlation in the phase-noise process. The received symbols are then derotated by the hard-decision phase estimates, and maximum-likelihood sequence detection of the symbols follows. As each component in the carrier-recovery unit can be separately optimized, the resulting system is highly flexible. We show that the optimum hard-decision phase estimator is a linear filter whose impulse response consists of a causal and an anticausal exponential sequence, which we can truncate and implement as an finite-impulse-response filter. We derive equations for the phase-error variance and the system bit-error ratio (BER). Our results show that 4, 8 and 16 quadrature-amplitude-modulation (QAM) transmisssion at 1 dB above sensitivity for BER = 10(-3) is possible with laser beat linewidths of Delta vT(b) = 1.3 x 10(-4), 1.3 x 10(-4), and 1.5 x 10(-5) when a decision-directed soft-decision phase estimator is employed.