/[pkg-mixmaster]/trunk/Mix/Src/rem.c
ViewVC logotype

Diff of /trunk/Mix/Src/rem.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 51 by rabbi, Fri Dec 14 22:24:18 2001 UTC revision 52 by rabbi, Sat Dec 15 05:10:52 2001 UTC
# Line 6  Line 6 
6     details.     details.
7    
8     Process remailer messages     Process remailer messages
9     $Id: rem.c,v 1.6 2001/12/14 22:24:18 rabbi Exp $ */     $Id: rem.c,v 1.7 2001/12/15 05:10:52 rabbi Exp $ */
10    
11    
12  #include "mix3.h"  #include "mix3.h"
# Line 387  int blockrequest(BUFFER *message) Line 387  int blockrequest(BUFFER *message)
387      if (bufifind(line, "destination-block")) {      if (bufifind(line, "destination-block")) {
388        buf_clear(addr);        buf_clear(addr);
389        request = 1;        request = 1;
390        if (buffind(line, "@")) {        {
391          int c = 0;          int c = 0;
392    
393          while (!strileft(line->data + line->ptr, "block"))          while (!strileft(line->data + line->ptr, "block"))
394            line->ptr++;            line->ptr++;
395          while (c != ' ')          while (c != ' ' && c != -1)
396            c = tolower(buf_getc(line));            c = tolower(buf_getc(line));
397          while (c == ' ')          while (c == ' ')
398            c = buf_getc(line);            c = buf_getc(line);
399          do {          if (c != -1)
400            buf_appendc(addr, c);            do {
401            c = buf_getc(line);              buf_appendc(addr, c);
402          } while (c > ' ');              c = buf_getc(line);
403        } else            } while (c > ' ');
         buf_set(addr, from);  
       {  
         BUFFER *real_addr;  
         real_addr = buf_new();  
         rfc822_addr (addr, real_addr);  
         buf_set (addr, real_addr);  
         buf_free (real_addr);  
404        }        }
405          if (addr->length == 0)
406            rfc822_addr (addr, from);
407        if (addr->length == 0) {        if (addr->length == 0) {
408          return (2);          return (2);
409        };        };
410        if (! buffind(addr, "@"))        if (! buffind(addr, "@"))
411        {        {
412          errlog(LOG, "Ignoring blocking request for %b from %b (no @ sign in address).\n", addr, from);          errlog(LOG, "Ignoring blocking request for %b from %b "
413              "(no @ sign in address).\n", addr, from);
414          return (2);          return (2);
415        };        };
416        if (bufieq(addr, REMAILERADDR)) {        if (bufieq(addr, REMAILERADDR)) {
# Line 422  int blockrequest(BUFFER *message) Line 418  int blockrequest(BUFFER *message)
418          return (2);          return (2);
419        }        }
420        if (bufleft(addr, "/")) {        if (bufleft(addr, "/")) {
421          errlog(LOG, "Ignoring blocking request: %b from %b is a regex.\n", addr, from);          errlog(LOG, "Ignoring blocking request: %b from %b is a regex.\n",
422              addr, from);
423          return (2);          return (2);
424        }        }
425        if (buf_ieq(addr, from))        if (buf_ieq(addr, from))

Legend:
Removed from v.51  
changed lines
  Added in v.52

  ViewVC Help
Powered by ViewVC 1.1.5