🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #36572

INN 2.2: mailpost - "First line with leading whitespace!"

#36572
From: Geoff Gibbs
Date: Wed, 14 Apr 1999 00:00
53 lines
2166 bytes
There is a bug in mailpost, which produces the error message

"First line with leading whitespace!"

when it is fed an e-mail, where the body of the message starts with
a space. (i.e. headers,blank line,space ...)

The bug is in the code for handling header continuation lines. I believe
that the following patch fixes the problem, although you may well be
able to improve the Perl ;-)

Geoff Gibbs
--- 
UK-Human Genome Mapping Project-Resource Centre,
Hinxton, Cambridge, CB10 1SB, UK
Tel: +44 1223 494530  Fax: +44 1223 494512  E-mail: G.Gibbs@hgmp.mrc.ac.uk
---

*** mailpost.orig	Wed Feb 17 09:58:52 1999
--- mailpost	Wed Apr 14 14:24:06 1999
***************
*** 152,157 ****
--- 152,159 ----
  }
  
  for (;;) {
+     last if defined($line) && ($line =~ /^$/) ;
+ 
      $_ = <STDIN> ;
      chomp ;
  
***************
*** 284,290 ****
  ${weird_mail_hdrs}
  EOF
      
! print TMPFILE $line, "\n" ;	# left over from header parsing loop
  print TMPFILE <STDIN>;
  # do we really want to add this next line? (inews will append a signature)
  print TMPFILE "---\n" ; 
--- 286,292 ----
  ${weird_mail_hdrs}
  EOF
      
! # print TMPFILE $line, "\n" ;	# left over from header parsing loop
  print TMPFILE <STDIN>;
  # do we really want to add this next line? (inews will append a signature)
  print TMPFILE "---\n" ; 




Technical Details
Message-ID: <7f26n0$ifk$1@niobium.hgmp.mrc.ac.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <7f26n0$ifk$1@niobium.hgmp.mrc.ac.uk>
Subject: INN 2.2: mailpost - "First line with leading whitespace!"
Date: Wed, 14 Apr 1999 00:00:00 +0000
From: ggibbs@hgmp.mrc.ac.uk (Geoff Gibbs)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 466298303
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@hgmp.mrc.ac.uk
X-Trace: niobium.hgmp.mrc.ac.uk 924098080 18932 193.62.192.79 (14 Apr 1999 13:54:40 GMT)
Organization: MRC Human Genome Mapping Project Resource Centre
Mime-Version: 1.0
NNTP-Posting-Date: 14 Apr 1999 13:54:40 GMT
Newsgroups: news.software.nntp