Fix handlig of the references header when fetching message envelopes.