We study the optimal control of propagation of packets in delay tolerant mobile ad-hoc networks. We consider a two-hop forwarding policy under which the expected number of nodes carrying copies of the packets obeys a linear dynamics. We exploit this property to formulate the problem in the framework of linear quadratic optimal control which allows us to obtain closed-form expressions for the optimal control and to study numerically the tradeoffs by varying various parameters that define the cost.