code: def parse_msg_sender(filename, sender_known=True):
      
      import sys
      kwargs = {}
      if sys.version_info > (3, 0):
          kwargs["encoding"] = "utf8"
  
      sender, msg = None, None
      if os.path.isfile(filename) and not is_sender_filename(filename):
          with open(filename, **kwargs) as f:
              msg = f.read()
              sender = u''
              if sender_known:
                  sender_filename = build_sender_filename(filename)
                  if os.path.exists(sender_filename):
                      with open(sender_filename) as sender_file:
                          sender = sender_file.read().strip()
                  else:
                      # if sender isn't found then the next line fails
                      # and it is ok
                      lines = msg.splitlines()
                      for line in lines:
                          match = re.match('From:(.*)', line)
                          if match:
                              sender = match.group(1)
                              break
      return (sender, msg)
docs: Given a filename returns the sender and the message.
  
      Here the message is assumed to be a whole MIME message or just
      message body.
  
      >>> sender, msg = parse_msg_sender('msg.eml')
      >>> sender, msg = parse_msg_sender('msg_body')
  
      If you don't want to consider the sender's name in your classification
      algorithm:
      >>> parse_msg_sender(filename, False)