def compress_and_sort_index(self):
        """Sort index, add header, and compress.

        :rtype: bool
        :returns: True

        """
        idx_fname = '{name}.{date}.mbox.csv'.format(**self.__dict__)
        try:
            reader = csv.reader(open(idx_fname), dialect='excel-tab')
        except IOError:
            return False
        index = [x for x in reader if x]
        sorted_index = sorted(index, key=itemgetter(0))
        gzip_idx_fname = idx_fname + '.gz'

        # Include UTF-8 BOM in header.
        header = [
            '\xef\xbb\xbf#date', 'msg_id', 'from', 'newsgroups', 'subject', 'references',
            'start', 'length',
        ]

        s = cStringIO.StringIO()
        writer = csv.writer(s, dialect='excel-tab')
        writer.writerow(header)
        for line in sorted_index:
            writer.writerow(line)
        compressed_index = inline_compress_chunk(s.getvalue())
        s.close()

        with open(gzip_idx_fname, 'ab') as fp:
            fp.write(compressed_index)
        os.remove(idx_fname)
        return True
Sort index, add header, and compress.

        :rtype: bool
        :returns: True