I am writing a C program to execute on Unix systems that will receive
incoming mail on its stdin and I need to parse out the "to", "from",
"reply-to", "subject", and message body. I have some questions.
1) What are the standard ways of doing this? Is there a standard format
specification (at least among Unix systems)? How standard are mail
headers found in Unix mailbox files? I would like my program to work
under as many variants of Unix as possible.
2) What is the standard way of distinguishing the from address? I have
seen forms such as these in my mail
Joe Smith <joe> Mail from another user at my host
joe (Joe Smith)
I would like to separate out just the from address without the name.
3) How will multiple "to"'s or "cc"'s appear in a header?
4) What is the best way to get the correct from address from a mail
message to automatically send a reply (e.g. for an autoresponder
application). Would you look for "reply-to" and if not found, look for
"from"?
Thanks in advance for any assistance.
Terry Koyn