'Decodes email subjects'

def decode_subject(self, subject):

    if (not subject):
        subject = 'No    subject'
        encoding = None
    else:
        (subject, encoding) = decode_header(subject)[0]
        subject = self.decode(subject, encoding)
    return (subject, encoding)
