Subject: Re: bug#2196: 23.0.90; rmail not reading email

From: Glenn Morris <[email-masked]>
Date: Mon, 09 Feb 2009 22:35:44 -0500

retitle 2196 movemail.c, pop, and mbox
severity 2196 minor
stop

jpff wrote:

> I think the culprit is movemail in lib-src

Indeed. The specific bit you cited is not a problem (I think), but the
functions mbx_delimit_begin and mbx_delimit_end are Babyl-specific,
and so movemail was totally broken for the retrieval of mail via pop.
That's rather bad.

I've installed a fix that just prints

>From movemail

at the start of each message. I think this is enough to make it work.
It would be nice to add the time:

>From movemail  Mon Feb  9 14:51:58 2009

A further patch for this is attached. I don't know how
correct/portable the code is though (?).

*** movemail.c	10 Feb 2009 03:30:41 -0000	1.98
--- movemail.c	10 Feb 2009 03:31:20 -0000
***************
*** 60,65 ****
--- 60,67 ----
  #include <sys/file.h>
  #include <stdio.h>
  #include <errno.h>
+ #include <string.h>
+ #include <time.h>
  
  #include <getopt.h>
  #ifdef HAVE_UNISTD_H
***************
*** 923,929 ****
  mbx_delimit_begin (mbf)
       FILE *mbf;
  {
!   if (fputs ("From movemail\n", mbf) == EOF)
      return (NOTOK);
    return (OK);
  }
--- 925,940 ----
  mbx_delimit_begin (mbf)
       FILE *mbf;
  {
!   time_t now;
!   struct tm *ltime;
!   char fromline[40] = "From movemail ";
! 
!   now = time (NULL);
!   ltime = localtime (&now);
! 
!   strcat (fromline, asctime (ltime));
! 
!   if (fputs (fromline, mbf) == EOF)
      return (NOTOK);
    return (OK);
  }