[exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Philip Hazel
Päiväys:  
Vastaanottaja: exim-cvs
Aihe: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim/exim-src/src filter.c
ph10 2005/11/10 15:00:46 GMT

  Modified files:
    exim-doc/doc-txt     ChangeLog 
    exim-src/src         filter.c 
  Log:
  Log only the actual address (not the whole To: header) when generating
  an autoreply from a filter.


  Revision  Changes    Path
  1.253     +11 -0     exim/exim-doc/doc-txt/ChangeLog
  1.6       +44 -4     exim/exim-src/src/filter.c


  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
  retrieving revision 1.252
  retrieving revision 1.253
  diff -u -r1.252 -r1.253
  --- ChangeLog    20 Oct 2005 15:19:13 -0000    1.252
  +++ ChangeLog    10 Nov 2005 15:00:46 -0000    1.253
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.252 2005/10/20 15:19:13 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.253 2005/11/10 15:00:46 ph10 Exp $


Change log file for Exim from version 4.21
-------------------------------------------
@@ -40,6 +40,17 @@

   PH/04 SUPPORT_TRANSLATE_IP_ADDRESS and MOVE_FROZEN_MESSAGES did not cause
         anything to be listed in the output from -bV.
  +
  +PH/05 When a filter generated an autoreply, the entire To: header line was
  +      quoted in the delivery log line, like this:
  +
  +        => >A.N.Other <ano@???> <original@ddress> ...
  +
  +      This has been changed so that it extracts the operative address. There
  +      may be more than one such address. If so, they are comma-separated, like
  +      this:
  +
  +        => >ano@???,ona@??? <original@ddress> ...



Exim version 4.54

  Index: filter.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/filter.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- filter.c    3 Oct 2005 11:26:21 -0000    1.5
  +++ filter.c    10 Nov 2005 15:00:46 -0000    1.6
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/filter.c,v 1.5 2005/10/03 11:26:21 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/filter.c,v 1.6 2005/11/10 15:00:46 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -2207,12 +2207,16 @@
       else
         {
         uschar *tt;
  +      uschar *log_addr = NULL;
         uschar *to = commands->args[mailarg_index_to].u;
  +      int size = 0;
  +      int ptr = 0;
  +
         if (to == NULL) to = expand_string(US"$reply_address");
         while (isspace(*to)) to++;


  -      for (tt = to; *tt != 0; tt++)     /* Get rid of newlines so that */
  -        if (*tt == '\n') *tt = ' ';     /* the eventual log line is OK */
  +      for (tt = to; *tt != 0; tt++)     /* Get rid of newlines */
  +        if (*tt == '\n') *tt = ' ';


         DEBUG(D_filter)
           {
  @@ -2235,9 +2239,45 @@
             }
           }


  -      /* Create the "address" for the autoreply */
  +      /* Create the "address" for the autoreply. This is used only for logging,
  +      as the actual recipients are extraced from the To: line by -t. We use the
  +      same logic here to extract the working addresses (there may be more than
  +      one). */
  +
  +      tt = to;
  +      while (*tt != 0)
  +        {
  +        uschar *ss = parse_find_address_end(tt, FALSE);
  +        uschar *recipient, *errmess;
  +        int start, end, domain;
  +        int temp = *ss;
  +
  +        *ss = 0;
  +        recipient = parse_extract_address(tt, &errmess, &start, &end, &domain,
  +          FALSE);
  +        *ss = temp;
  +
  +        /* Ignore empty addresses and errors; an error will occur later if
  +        there's something really bad. */
  +
  +        if (recipient != NULL)
  +          {
  +          log_addr = string_cat(log_addr, &size, &ptr,
  +            (log_addr == NULL)? US">" : US",", 1);
  +          log_addr = string_cat(log_addr, &size, &ptr, recipient,
  +            Ustrlen(recipient));
  +          }
  +
  +        /* Move on past this address */
  +
  +        tt = ss + (*ss? 1:0);
  +        while (isspace(*tt)) tt++;
  +        }
  +
  +      if (log_addr == NULL) log_addr = string_sprintf("invalid-to-line");
  +        else log_addr[ptr] = 0;


  -      addr = deliver_make_addr(string_sprintf(">%.256s", to), FALSE);
  +      addr = deliver_make_addr(log_addr, FALSE);
         setflag(addr, af_pfr);
         if (commands->noerror) setflag(addr, af_ignore_error);
         addr->next = *generated;