code: def has_bad_headers(self):
          
          headers = [self.sender, self.reply_to] + self.recipients
          for header in headers:
              if _has_newline(header):
                  return True
  
          if self.subject:
              if _has_newline(self.subject):
                  for linenum, line in enumerate(self.subject.split('\r\n')):
                      if not line:
                          return True
                      if linenum > 0 and line[0] not in '\t ':
                          return True
                      if _has_newline(line):
                          return True
                      if len(line.strip()) == 0:
                          return True
          return False
docs: Checks for bad headers i.e. newlines in subject, sender or recipients.
          RFC5322 allows multiline CRLF with trailing whitespace (FWS) in headers