home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / emacs / bug / 1237 < prev    next >
Encoding:
Text File  |  1992-09-04  |  4.9 KB  |  123 lines

  1. Newsgroups: gnu.emacs.bug
  2. Path: sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!edscom.demon.co.uk!kevin
  3. From: kevin@edscom.demon.co.uk (Kevin Broadey)
  4. Subject: Re: BUG ALERT: sendmail.el - how to fix your Rmail FCC files
  5. Message-ID: <KEVIN.92Sep4084901@runningbear.edscom.demon.co.uk>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: EDS-Scicon, Milton Keynes, UK
  8. References: kevin@edscom.demon.co.uk (Kevin Broadey)
  9. Distribution: gnu
  10. Date: Fri, 4 Sep 1992 08:49:01 GMT
  11. Approved: bug-gnu-emacs@prep.ai.mit.edu
  12. Lines: 109
  13.  
  14. If anyone out there has a broken Rmail FCC file and is cursing me for
  15. posting a crappy "fix", please accept my humblest appologies.  If it's
  16. any consolation, my FCC file got knackered too.  This article describes
  17. the steps I took to fix it.
  18.  
  19. If your file is still broken after you've tried this, mail me and I'll
  20. do my best to help sort it out.
  21.  
  22. --Kevin
  23.  
  24.  
  25. First, the history of the wretched thing so that we're both talking
  26. about the same thing:-
  27.  
  28. 1)  I noticed that FCC copies of messages sent using "sendmail" were
  29.     getting lost if the FCC file was being visited in RMAIL mode (or any
  30.     other mode for that matter).
  31.  
  32.     I traced the fault to `mail-do-fcc' in sendmail.el, which simply
  33.     used `write-region' to append the message to the disk file
  34.     regardless of whether it was being visited.
  35.  
  36.     I knew that GNUS didn't have the same problem so I checked how it
  37.     did it.  This led to the first "sendmail.el" change that I posted in
  38.     gnu.emacs.sources and gnu.emacs.gnus - "Improved FCC handling for
  39.     sendmail" - on August 21st.
  40.  
  41. 2)  As I started using sendmail FCCs more regularly, I noticed that
  42.     there was nothing in the To/From field in the RMAIL-summary buffer
  43.     and that the message header in the RMAIL buffer didn't have the
  44.     "Date:" and "From:" fields that are present in normal mail.
  45.  
  46.     RMAIL-summary usually shows who a message is from, except that when
  47.     it is from you, it shows who it is to.  I assumed that the To/From
  48.     field was left blank because RMAIL-summary couldn't find a "From:"
  49.     line, so I came up with my ill-fated fix of changing "sendmail.el"
  50.     to insert "Date: ...\nFrom: user".  This was posted to gnu.emacs.bug
  51.     - "sendmail.el - FCC output doesn't have "From:" header field" - on
  52.     August 28th.
  53.  
  54.     It worked fine when I tested it.  Unfortunately I didn't realise
  55.     that I was always visiting the FCC file when I tested, so I didn't
  56.     spot the "unvisited file" problem.
  57.  
  58. 3)  On September 2nd I realised that message FCCs weren't there when I
  59.     read the FCC file using RMAIL.  After a fair amount of digging
  60.     around I realised that my "fix" was causing the problem because new
  61.     messages weren't being appended to the FCC file in UNIX mail format.
  62.     I fixed my FCC file (eventually) and corrected my fix so that it did
  63.     The Right Thing when the file wasn't being visited or wasn't in
  64.     RMAIL mode.  I then started looking at my BABYL conversion routine,
  65.     and realised that I could use RMAIL's own.  While I was looking
  66.     through this i realised that the thing that was messing up the
  67.     header conversion was the format of the date in the "From" line.
  68.  
  69.     I posted the fixed fix to gnu.emacs.bug and gnu.emacs.sources -
  70.     "BUG ALERT: sendmail.el - FCC output doesn't have "From: " header
  71.     field" - on September 2nd.
  72.  
  73.  
  74. Strewth! That was a bit long! Anyway, I'm assuming you got screwed up
  75. after applying the patch mentioned in (2) above, so here's what you've
  76. got to do to recover your FCC file.
  77.  
  78. 1)  Run RMAIL on the file and do `h' to view the summary buffer.  Note
  79.     which message is the last one.
  80.  
  81. 2)  Switch to the RMAIL buffer and do
  82.  
  83.     C-x w (widen)
  84.     M-x fundamental-mode RET
  85.  
  86. to get you out of RMAIL mode so you can edit the raw file.
  87.  
  88. 3)  Find the last message, as noted in (1). Go to the end of the message
  89.     and, on a line on its own, insert ^_ (a single character, control
  90.     underscore) - you can do this by typing C-q C-_.  Note that this
  91.     character may already be there (Rmail puts one at the end of the
  92.     file).  If it is there, *don't* put another one in.
  93.  
  94. 4)  Move down the file looking for the start of each new message. They
  95.     should begin something like:-
  96.  
  97.     Date: Thu Sep  3 17:47:05 1992
  98.     From: me
  99.  
  100.     Change these 2 lines to be:-
  101.  
  102.     From me Thu Sep  3 17:47:05 BST 1992
  103.  
  104.     Remember to put the time zone in.
  105.  
  106. 5)  Check for control characters (eg ^_) at the *end* of the file.
  107.     Delete them.
  108.  
  109. 6)  Save the file (C-x C-s) and kill the buffer (C-x k RET).
  110.  
  111. 7)  Cross your fingers :-) and run RMAIL on the file.  It should convert
  112.     all your missing messages into BABYL format and everything should be
  113.     wonderful.
  114.  
  115. 8)  Apply the corrected patch to your sendmail.el.
  116.  
  117. --
  118. Kevin Broadey <kbroadey@edscom.demon.co.uk>
  119. EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
  120. Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
  121. These opinions are mine: others available on request.
  122.  
  123.