'Deletes headers in the given list from the message content.
Arguments:
- content: message itself
- header_list: list of headers to be deleted or just the header name
We expect our message to have \'
\' as line endings.'

def deletemessageheaders(self, content, header_list):

    if (type(header_list) != type([])):
        header_list = [header_list]
    self.ui.debug('', ('deletemessageheaders:    called    to    delete    %s' % header_list))
    if (not len(header_list)):
        return content
    eoh = self.__find_eoh(content)
    self.ui.debug('', ('deletemessageheaders:    end    of    headers    =    %d' % eoh))
    headers = content[0:eoh]
    rest = content[eoh:]
    self.ui.debug('', ('deletemessageheaders:    headers    =    %s' % repr(headers)))
    new_headers = []
    for h in headers.split('\n'):
        keep_it = True
        for trim_h in header_list:
            if ((len(h) > len(trim_h)) and (h[0:(len(trim_h) + 1)] == (trim_h + ':'))):
                keep_it = False
                break
        if keep_it:
            new_headers.append(h)
    return ('\n'.join(new_headers) + rest)
