Once upon a time keeping the mail moving and delivered on time meant that it traveled much of its journey via the railroads, and this was the job of the Railway Post Office (also known simply as the RPO). The RPO was essentially a moving post office and the clerks on board had to undergo rigorous training to make sure they could handle the blitzkrieg of work involved. Once the government contracted mail movements exclusively to the railroads soon after they became an efficient and recognized mode of transportation in the early part of the 19th century a new car was born to handle the work, the RPO. Depending on the volume of mail moving on a particular train it could have a dedicated RPO car or be included within a combine (a type of car that housed two types of services, such as space for general baggage or even a seating section for passengers). When the government pulled its mail contracts in the late 1960s the purpose of the RPO ended.
Mail traveling via railroad in the United States first began in early July, 1838 when Congress authorized the railroad industry to handle all such parcels and shipments (partly because, even during that time when few lines existed, railroads were the most efficient and fastest way to move literally anything). Interestingly, this authorization occurred just a decade after the creation of the Baltimore & Ohio Railroad, our country's first common-carrier railroad. It is also noteworthy to point out that for nearly three decades following the industry's mail contract there was no dedicated car to handle the freight. Not until 1862 was the Railway Post Office setup, which during that time consisted essentially of using converted baggage cars to store and sort mail. Two years after the creation of the RPO its first route was inaugurated between Chicago and Clinton, Iowa and by 1869 an official agency, the Railway Mail Service was created to oversee the movement and handling of mail aboard trains.
The effectiveness of the Railway Post Office was in its ability to tap virtually every town in America as by the turn of the 20th century railroads sprawled to serve nearly every one. With coordinated routing and expedited service provided by passenger trains, mail by rail could quickly reach its intended destination and was very efficient. The first dedicated RPO car was designed by Charles Harrison. Basically it was retrofitted baggage car as the interior featured hinged iron (later steel) railings that could hold mail bags for easy reach and sorting. Along with this feature Harrison's design also included sorting tables and overhead storage bins to easily sort the mail while en route. A few years after designing the original RPO car Harrison set up his own manufacturing company in 1881, which essentially retrofitted baggage cars for mail service.
A few years after Harrison began manufacturing his RPO car layout the Railway Mail Service used as the standard for all such cars, with small improvements like better lighting and heavier car frames for added safety in the event of a crash or accident. While standard baggage cars were always the basis upon which RPOs were built by the late 19th century the two may have looked the same but were far different in terms of construction. One feature which made RPO cars unique among all other mail in a passenger train consists was its mail hook, which was located right next to a door to catch a bag of hanging mail at a station.
Since passenger trains did not stop at every station along a particular route this was the fastest and most efficient way to pick up out-going mail, which was placed on a snagging device (known as a trackside mail crane) by the station postal agent. Likewise, if a train was dropping off mail but was not stopping at a particular station the on board agents would simply kick or toss it out the door making sure it traveled far enough away from the train not to get caught underneath it. Working as a clerk on board a Railway Post Office car meant you had to be very good at what you did and very fast, as sometimes you did not have a lot of time for sorting between routes. When sorting one's accuracy rate had to be extremely efficient as anything under near 100% could result in a reprimand or (if the work was really awful) an outright firing.
Since the Railway Post Office operated as an express service on railroads it almost always was included in a passenger train's head-end equipment. As this service began to rapidly deteriorate from roughly the mid/late-1950s onward with more and more passengers switching from riding the rails to either driving their own vehicles or flying, it comes as no surprise that the government decided pull the plug on its contract to move mail over the railroads. Of course, this wasn't the only reason, with improved highways and air travel it became cheaper and more efficient to move mail via the modes as well and in September of 1967 the official word came that the contract was canceled. By that point many remaining passenger trains still in service were deriving most, if not all, of their revenue from the lucrative government mail contracts and with its cancellation railroads were quick to drop as many trains as they could (and just four years late in 1971 they got their wish with the creation of Amtrak).
For more reading about RPOs the book American Passenger Train Equipment: 1940s-1980s by author Patrick Dorin provides a very nice general history of classic car types used in service (predominantly during the streamlined era) featuring many drawings and detailed information on several. Also, the book The Cars of Pullman from author Joe Welsh, Bill Howes, and Kevin Holland. As the title implies the book details and highlights the various types of cars Pullman built throughout the years, along with giving a general history of the company in the process.