'Find all header lines matching a given header name.
Look through the list of headers and find all lines matching a given
header name (and their continuation lines).  A list of the lines is
returned, without interpretation.  If the header does not occur, an
empty list is returned.  If the header occurs multiple times, all
occurrences are returned.  Case is not important in the header name.'

def getallmatchingheaders(self, name):

    name = (name.lower() + ':')
    n = len(name)
    lst = []
    hit = 0
    for line in self.headers:
        if (line[:n].lower() == name):
            hit = 1
        elif (not line[:1].isspace()):
            hit = 0
        if hit:
            lst.append(line)
    return lst
