The correct creation of message headers is much more complicated than most people think. There are at least four RFCs involved, and these are certainly not the smallest and simplest!