John,
Unfortunately there is no explicit command in the POP spec there is in the IMAP spec for header specific retrieval.
If you just want to get the headers on any POP message, you'll need to do the follow:
- connect to the POP mailbox
- Find out how many messages there are (the STAT command)
- For each message use the TOP n,0 where n is the message number. This will give you the header.
The downside of this is that you can't get the size of the attachment or how many attachments you have. All you can say is that if there is a mixed / multipart boundary then you have an attachment.
CHeers
Justin