accepted answer has been given by Jay

There are some bath fan installing tricks, all of them meant to help you avoid ending up with mildew in your bath. There are two basic rules before starting placing the fan: seal everything and insulate everything. Make sure you use sheet metal screws on all joints, after which use aluminium foil tape over them. Insulate around the piping but don’t use plastic, because moisture escapes through plastic.