Most of those who settled in the archipelago had already severed their ties with the mainland and welcomed favorable treatment and protection under the Dutch. Some became "revenue farmers", middlemen within the corporate structure of the VOC, tasked with collecting export–import duties and managing the harvest of natural resources; although this was highly profitable, it earned the enmity of the "pribumi" population. Others worked as opium farmers. Following the 1740 Batavia massacre and ensuing war, in which the Chinese rebelled against the Dutch, the Dutch attempted to place a quota on the number of Chinese who could enter the Indies. Amoy was designated as the only immigration port to the archipelago, and ships were limited to a specified number of crew and passengers depending on size. This quota was adjusted at times to meet demand for overseas workers, such as in July 1802 when sugar mills near Batavia were in need of workers.