let header s msg = let rec hdr = function [] -> [] | (h,v) :: rem -> if h = s then v :: hdr rem else hdr rem in String.concat "\n" (hdr msg.headers)