Monday, June 25, 2007

fetchmail -- by Eric S Raymond

Raymond has written a famous book TAUP "The Art of Unix Programming", I borrowed it from library several times, I liked to read it--.

Until today, I download the source code of fetchmail, (it is a C case study in TAUP). Interesting found that fetchmail is really written by Raymond, so I see why there are a lot of samples are from fetchmail, POP3, SMTP etc, in the book (TAUP). Fetchmail is written by C and it is so neat!! As I cscope into it, the struct as "method", "query", etc, I like such nice design. When read the code, I found some routines are very long, is it a pity? But at least the whole functions or interfaces are kept light! The hard part to me is I am not going to learn the protocols (POP3, SMTP, RFCs). It is not documented in a doxygen layout although it contains a doxygen config file. Discard such things, I still think fetchmail is very good sample on C, it is great because it is coded farely "light" in C, even it deals with different protocols (RFCs).