Re: [Mixmaster-devel] beeing selective about what to dest block
Brought to you by:
weaselp
From: Peter P. <pe...@pa...> - 2001-12-15 00:40:52
|
Hi Len! On Fri, 14 Dec 2001, Len Sassaman wrote: > On Fri, 14 Dec 2001, Peter Palfrader wrote: >=20 > > Perhaps it should be changed to take the argument to dest block even if > > it includes no @-sign. If it turns out to be null, i.e. there is none, > > then use header from. >=20 > [...] >=20 > > Block From: if no argument is supplied > > Block Nothing if argument is supplied but turns out to be invalid for > > whatever reason. > > Otherwise block. >=20 > Sounds good to me. patch v3 Index: rem.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/mixmaster/Mix/Src/rem.c,v retrieving revision 1.5 diff -u -r1.5 rem.c --- rem.c 2001/12/12 19:29:52 1.5 +++ rem.c 2001/12/15 00:39:22 @@ -387,23 +387,39 @@ if (bufifind(line, "destination-block")) { buf_clear(addr); request =3D 1; - if (buffind(line, "@")) { + { int c =3D 0; =20 while (!strileft(line->data + line->ptr, "block")) line->ptr++; - while (c !=3D ' ') + while (c !=3D ' ' && c !=3D -1) c =3D tolower(buf_getc(line)); while (c =3D=3D ' ') c =3D buf_getc(line); - do { - buf_appendc(addr, c); - c =3D buf_getc(line); - } while (c > ' '); - } else - buf_set(addr, from); + if (c !=3D -1) + do { + buf_appendc(addr, c); + c =3D buf_getc(line); + } while (c > ' '); + } + if (addr->length =3D=3D 0) + rfc822_addr (addr, from); + if (addr->length =3D=3D 0) { + return (2); + }; + if (! buffind(addr, "@")) + { + errlog(LOG, "Ignoring blocking request for %b from %b " + "(no @ sign in address).\n", addr, from); + return (2); + }; if (bufieq(addr, REMAILERADDR)) { errlog(LOG, "Ignoring blocking request for %b from %b.\n", addr, from); + return (2); + } + if (bufleft(addr, "/")) { + errlog(LOG, "Ignoring blocking request: %b from %b is a regex.\n", + addr, from); return (2); } if (buf_ieq(addr, from)) yours, peter --=20 PGP signed and encrypted | .''`. ** Debian GNU/Linux ** messages preferred. | : :' : The universal | `. `' Operating System http://www.palfrader.org/ | `- http://www.debian.org/ |