libcmime  
A lightweight C mime library
save_attachment_to_file.c