In Delay Tolerant Networks (DTNs) the core challenge is to cope with lack of persistent connectivity and yet be able to deliver messages from source to destination. In particular, routing schemes that leverage relays’ memory and mobility are a customary solution in order to improve message delivery delay. So when large files need to be transferred from source to destination, not all packets may be available at the source prior to the first transmission. This motivates us to study general packet arrivals at the source, derive performance analysis of replication based routing policies and study their optimization under two hop routing. Here we determine the conditions for optimality in terms of probability of successful delivery and mean delay and we devise optimal policies, so-called piecewise-threshold policies. We account for linear block-codes and rate less random linear coding to efficiently generate redundancy, as well as for an energy constraint in the optimization.