A chimney liner must resist corrosion and safely contain carbon monoxide, moisture, creosote and smoke. Cracks or perforations in your existing liner mean you must reline the chimney. The National Fire Protection Administration regulations state that the liner must be under UL -- Underwriters Laboratory -- listing, constructed of metal or masonry and free of cracks or holes. Those that are not UL-listed should adhere to UL regulations, which is usually stated by the manufacturer.
Your flue liner should be large enough to properly vent exhaust from your appliance. The required size depends on the type of stove, the chimney height and the heat output. As a general rule, the liner should be at least 6 inches in diameter. Usually the required size will match the flue collar of the stove. For many wood stoves, this is 6 to 8 inches. Gas log fireplaces often require a diameter of at least 8 inches. The best way to determine your size is to review manufacturer requirements for the appliance.
Clay tiles usually compose the lining system of masonry chimneys. It can be difficult to reline or install an original liner out of this material. Retrofitted liner systems are often composed of flexible tubes of aluminum or stainless steel, which are directed down the chimney. Chimney liners must be composed of a material that is classified as sufficient to resist the corrosion caused by the appliance. This varies according to the uses of your appliance. Wood and pellet stoves require 304 stainless steel alloy, while gas and oil appliances require 316Ti, an alloy that better resists corrosion.
If the flue is oversized, unlined or has a broken liner, then you are required to retrofit it with a liner. An exception would be if you live in an old home with an unlined chimney. The original building codes will generally apply as long as you're using the chimney for its original purpose. But if you are changing its intended use, then you will need to install a chimney liner. For example, if you install a wood stove insert into your fireplace, the manufacturer may require that you install an approved liner. A gas appliance will also require specified liners. Always adhere to the manufacturer requirements for your particular appliance.