[PATCH 1/3] dmime: Split the segment object creation into a separate helper.