home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / mail / misc / 2795 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  2.6 KB

  1. Path: sparky!uunet!eiffel!eiffel.com
  2. From: ram@eiffel.com (Raphael Manfredi)
  3. Newsgroups: comp.mail.misc
  4. Subject: Re: What is the format of a mailbox file?
  5. Message-ID: <122@eiffel.eiffel.com>
  6. Date: 26 Aug 92 23:04:14 GMT
  7. References: <1992Aug26.203046.25591@murdoch.acc.Virginia.EDU>
  8. Sender: ram@eiffel.com
  9. Distribution: na
  10. Organization: Interactive Software Engineering, Santa Barbara CA
  11. Lines: 52
  12.  
  13. Quoting sdm7g@aemsun.med.Virginia.EDU (Steven D. Majewski) from comp.lang.perl:
  14. >What is the format of a unix mailbox file and where can the 
  15. >definition be found. ( I didn't see any pointers in the man
  16. >page for 'mail'. )
  17.  
  18. The format of the *unix* mail box (i.e. the format in which the mail
  19. delivery subsystem stores the mail in the system mail box) is really
  20. simple:
  21.  
  22. It starts with a From line describing the sender of the message (idented
  23. for clarity only):
  24.  
  25.     From <internet_address> <date string> [remote from <site>]
  26.  
  27. For instance:
  28.  
  29.     From ram@lyon.eiffel.com  Wed Aug 26 16:02:12 1992
  30.  
  31. The "remote from" part is used by UUCP and apparently by SYSV R4 mail.
  32. It is not recognized by old mail programs, I think.
  33.  
  34. Then the RFC-822 mail follows. It is composed of a set of headers, a
  35. blank line (single newline) which marks the end of header, and then the
  36. body of the mail itself. Note that the end of the message is marked by the
  37. end of the file, or the beginning of another message. This is why it is
  38. important to escape the leading "From" lines in the body of a message, or
  39. some simple mail handling tools are confused. Usually, appending a '>' as in
  40. >From is sufficient.
  41.  
  42. >How is the status of new, read, etc. indicated in the file? 
  43.  
  44. This is a mail user-agent convention, and it may vary. But traditional
  45. /usr/bin/mailx (aka /usr/ucb/Mail) simply add a Status: line in the header
  46. of the message.
  47.  
  48. >BTW: the reason for the question is that I need to write a filter
  49. >to split/merge and generally reorganize my mailboxes. If anyone has
  50. >any hints on a good program to do this, I'm listening. And that's why
  51. >I've tacked 'comp.lang.perl' onto the Newsgroups line. I would expect
  52. >someone must have done something like this in Perl, already. 
  53.  
  54. Sorry, I only have a perl program to sort message *before* they arrive into
  55. your mailbox. For post-processing, I use MH, which stores messages in
  56. individual files -- makes life *much* easier as you may use traditional
  57. shell scripts to process your mail and don't even have to use perl! :-)
  58.  
  59. Good luck!
  60. -- 
  61. Raphael Manfredi <ram@eiffel.com>
  62. Interactive Software Engineering Inc.
  63. 270 Storke Road, Suite #7                      / Tel +1 (805) 685-1006 \
  64. Goleta, California 93117, USA                  \ Fax +1 (805) 685-6869 /
  65.