def METHOD_NAME(self, folder: str, msg: str):
    """Upload a message to *folder*.
    Trailing whitespace or a linebreak at the beginning will be removed automatically.
    """
    if msg.startswith("\n"):
        msg = msg[1:]
    msg = "\n".join([s.lstrip() for s in msg.splitlines()])
    self.conn.METHOD_NAME(bytes(msg, encoding="ascii"), folder)