procmail
[Top] [All Lists]

BUG in Clenson pop daemon (was: Getting the correct From out of sendmail - summary )

1999-09-25 13:41:50
J S McKenzie <demo(_at_)mcb(_dot_)net> writes:
In message 
<199909240152(_dot_)UAA30074(_at_)aragorn(_dot_)it(_dot_)gac(_dot_)edu>, 
Philip Guenther
<guenther(_at_)gac(_dot_)edu> writes

If turning on the 'E' flag caused _more_ problems then the program that
actually reads the mailboxes (e.g., IMAP or POP server) has _got_ to be
the one at fault.  What is the actual program that accesses the mailboxes
and that claims that previously separate messages are really one?

POP3 Clemson daemon.   We have also now found a buffer overflow in the
parsing of that applications parsing of mails when long lines are in the
mail.  Increasing the buffer to 4096 stopped that problem.  We have not
retried capital E in case......

It's a bug in the Clemson pop3 daemon: once it hits a line in the
mailbox that's longer than 255 characters (including the newline), it
treats the rest of the mailbox as a continuation of that line.  If the
buffer you increased in size was the one in parse_down_mbox(), change
it back to 255 before applying the following patch:


*** mailbox.c.original  Sat Sep 25 15:26:25 1999
--- mailbox.c   Sat Sep 25 15:28:20 1999
***************
*** 141,159 ****
  parse_down_mbox(mbox_fp)
  FILE *mbox_fp;
  {
!   char inline[256],is_ln_st=TRUE;
    long cur_pos, last_pos;
    struct mail_ent *me_pre, *me_ptr=NULL;
  
    cur_pos=last_pos=0;
    while(fgets(inline,sizeof(inline),mbox_fp) != NULL)
    {
!     if(!is_ln_st) continue;  /* did we read a partial last time ? */
      /* see if we really read an entire line or not */
      if(index(inline,'\n') == NULL)
        is_ln_st = FALSE;
      else
        is_ln_st = TRUE;
      if(strncmp(inline,"From ",5) == NULL)
      {
        me_pre=me_ptr;
--- 141,160 ----
  parse_down_mbox(mbox_fp)
  FILE *mbox_fp;
  {
!   char inline[256],is_ln_st=TRUE,was_ln_st;
    long cur_pos, last_pos;
    struct mail_ent *me_pre, *me_ptr=NULL;
  
    cur_pos=last_pos=0;
    while(fgets(inline,sizeof(inline),mbox_fp) != NULL)
    {
!     was_ln_st=is_ln_st
      /* see if we really read an entire line or not */
      if(index(inline,'\n') == NULL)
        is_ln_st = FALSE;
      else
        is_ln_st = TRUE;
+     if(!was_ln_st) continue;  /* did we read a partial last time ? */
      if(strncmp(inline,"From ",5) == NULL)
      {
        me_pre=me_ptr;


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>