Re: [Exim] NULL / filter

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: Chris Edwards
CC: exim-users
題目: Re: [Exim] NULL / filter
On Mon, 11 Mar 2002, Chris Edwards wrote:

> | It may be that NULLs in the body have to be turned into something else
> | in the contents of $message_body.
>
> Sounds like that would help. In this case I'm not trying to match the
> NULLs - just want to match a pattern elsewhere in the message.


Below are patches for 3.35 and 4.01 that turn NULLs into spaces when
copying the data from the body into $message_body and $message_body_end.

Philip

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.




-----------------------------------------------------------------------
*** exim-3.35/src/expand.c  Tue Feb 19 10:10:43 2002
--- expand.c    Mon Mar 11 17:00:01 2002
***************
*** 572,580 ****
        lseek(deliver_datafile, start_offset, SEEK_SET);
        len = read(deliver_datafile, body, len);
        if (len >= 0) body[len] = 0;
!       while (*body != 0)
          {
!         if (*body == '\n') *body = ' ';
          body++;
          }
        }
--- 572,580 ----
        lseek(deliver_datafile, start_offset, SEEK_SET);
        len = read(deliver_datafile, body, len);
        if (len >= 0) body[len] = 0;
!       while (len > 0)
          {
!         if (body[--len] == '\n' || body[len] == 0) body[len] = ' ';
          body++;
          }
        }
-----------------------------------------------------------------------





-----------------------------------------------------------------------
*** exim-4.01/src/expand.c  Mon Mar  4 10:03:42 2002
--- expand.c    Mon Mar 11 16:52:40 2002
***************
*** 747,757 ****
          }
        lseek(deliver_datafile, start_offset, SEEK_SET);
        len = read(deliver_datafile, body, len);
!       if (len >= 0) body[len] = 0;
!       while (*body != 0)
          {
!         if (*body == '\n') *body = ' ';
!         body++;
          }
        }
      return (*ss == NULL)? US"" : *ss;
--- 747,759 ----
          }
        lseek(deliver_datafile, start_offset, SEEK_SET);
        len = read(deliver_datafile, body, len);
!       if (len > 0)
          {
!         body[len] = 0;
!         while (len > 0)
!           {
!           if (body[--len] == '\n' || body[len] == 0) body[len] = ' ';
!           }
          }
        }
      return (*ss == NULL)? US"" : *ss;
-----------------------------------------------------------------------