def METHOD_NAME(smtp_response: str) -> Callable[[], int]:
    def inner():
        empty_port = closed_dummy_server()
        class ResponseHandler:
            async def handle_DATA(self, server, session, envelope) -> str:
                return smtp_response
        controller = Controller(
            ResponseHandler(), hostname="localhost", port=empty_port
        )
        controller.start()
        return controller.server.sockets[0].getsockname()[1]
    return inner