blank lines v. the remailer

Scott Collins collins at newton.apple.com
Thu Sep 9 13:52:26 PDT 1993


  >        Upon repeated tests of my remailers, I noticed that if there's
  >more than one blank line between the header and the header-pasting, then
  >the pasting doesn't take place. Does this happen with other people's
  >remailers? How is your script different from mine? How can this be fixed?

What follows is some of the text of the recurse.pl script, a component of
the remailer system.  I imagine that there are different versions of this
script floating around, but this is the version I got from
soda.berkeley.com when I set up my remailer.  I have commented it (and
noted my comments with 'SC:') to explain the relevent behavior, and deleted
non-relevent sections:

----------cut here----------

  # SC:read the header, looking for relevent lines

while (<>) {                # SC:get the next line (from where ever) into $_
        s/[ \t\r]*$// ;     # SC:remove trailing white space from $_
        last if /^$/ ;      # SC:get out if this line ($_) is otherwise blank
       ...code deleted here...
}


# SC:at this point $_ contains the blank line that followed the header
#  unless there was no blank line or message following the header (bad message)


  # We have just read the last line in the header.
  # Now we check to see if there is a pasting operator.

if ( ( $_ = <> ) && /^::[ \t\r]*$/ ) {

  # SC:get the next line (from where ever) into $_ ('if' can't use 'while'
  #  magic form), and if that next line is the pasting token then...

           # SC:append all the folling lines (up to, but not including,
           #  the next blank one) to the header
        while (<>) {
           ...code deleted here...
        }
} 

...code deleted here...
----------cut here----------

You can see (from the condition of the 'if') that this code only finds the
pasting token if it is separated from the header by exactly one blank line.

This is easy enough to fix, if it is not the desired behavior, by inserting

while (<>) {
  last unless /^[ \t\r]*$/ ;
}

before the 'if' and removing the '($_=<>) &&' from the if condition.

Hope this helps,


Scott Collins         | "Few people realize what tremendous power there
                      |  is in one of these things."     -- Willy Wonka
......................|................................................
BUSINESS.   voice:408.862.0540  fax:974.6094   collins at newton.apple.com
Apple Computer, Inc.   1 Infinite Loop, MS 301-2C   Cupertino, CA 95014
.......................................................................
PERSONAL.   voice/fax:408.257.1746    1024:669687   catalyst at netcom.com







More information about the cypherpunks-legacy mailing list