Section 37-8-27 shall not apply to employees of railroads, or other common carriers and their families, nor to the widows and dependent children of deceased employees, nor to employees who have retired from active service, by reason of age or physical infirmities, and the wives and dependent children of the latter, nor to officers or agents, surgeons, physicians and attorneys-at-law of such carriers, and the immediate families of such persons, to sheriffs, to ministers of religion, traveling secretaries of the Young Men's Christian Association and the Young Women's Christian Association, inmates of hospitals and charitable and eleemosynary institutions and persons exclusively engaged in charitable and eleemosynary work; to indigent, destitute and homeless persons, and to such persons when transported by charitable societies and hospitals and the necessary agents, employed in such transportation; to the widows of soldiers who served during the Civil War; to inmates of the national home or state home for disabled volunteer soldiers, and of sailors and soldiers homes, including those about to enter, and those returning home after discharge and boards of managers of such homes; to necessary caretakers of livestock, poultry and fruit, to employees on sleeping cars and express cars, and to linemen of telegraph and telephone companies, to railway mail service employees, postoffice inspectors, custom inspectors, and immigration inspectors, to newsboys on trains, baggage agents, witnesses attending any legal investigation in which the carrier is interested, persons injured in wrecks when being transported from the place of injury to their homes and places of treatment and physicians and nurses attending such persons; and members of the public service commission, and its agents and employees when traveling on official business only; but this section shall not be construed to prohibit the interchange of passes for the officers, agents, and employees of railroads and other common carriers and their immediate families, nor prohibit any such carrier from carrying passengers free with the object of providing relief in cases of general epidemic, pestilence or other calamitous visitation. Editors and publishers of newspapers in Alabama may exchange with railroads and other common carriers in this state advertisements and space in the columns of their newspapers for mileage issued to editors and publishers of newspapers over the railroads and other common carriers.