class Mail::Part

def add_content_id(content_id_val = '')

It will preserve the content ID you specify if you do.

specifying a content id.
a unique content ID if you try and encode it or output it to_s without
into the Header. The ContentIdField object will automatically generate
Creates a new empty Content-ID field and inserts it in the correct order
def add_content_id(content_id_val = '')
  header['content-id'] = content_id_val
end