If you have a square chimney with a pipe of the same height as the masonry, you must first close the gap between the pipe and the masonry and then install the chimney fan directly on the masonry. Similarly, if the pipe is only a few centimeters (or inches) high, the pipe must be brought to the same height as the masonry.
In this situation you have to buy the model of chimney fan with square base, adjustable also for rectangular chimney.