1993-09-09 - blank lines v. the remailer

Header Data

From: collins@newton.apple.com (Scott Collins)
To: klbarrus@owlnet.rice.edu
Message Hash: 846b17ad937f6ab2d8a37458614d85e1c8412f4069dcf38c8d42a07fc84ded58
Message ID: <9309092017.AA13959@newton.apple.com>
Reply To: N/A
UTC Datetime: 1993-09-09 20:52:26 UTC
Raw Date: Thu, 9 Sep 93 13:52:26 PDT

Raw message

From: collins@newton.apple.com (Scott Collins)
Date: Thu, 9 Sep 93 13:52:26 PDT
To: klbarrus@owlnet.rice.edu
Subject: blank lines v. the remailer
Message-ID: <9309092017.AA13959@newton.apple.com>
MIME-Version: 1.0
Content-Type: text/plain


  >        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@newton.apple.com
Apple Computer, Inc.   1 Infinite Loop, MS 301-2C   Cupertino, CA 95014
.......................................................................
PERSONAL.   voice/fax:408.257.1746    1024:669687   catalyst@netcom.com






Thread