🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #88634

Re: INN/inews behavior on \r\n

#88634
From: John Levine
Date: Thu, 25 Feb 2021 04:54
30 lines
2124 bytes
In article <s1715o$e99$1@dont-email.me>, mg  <mglover@pobox.com> wrote:
>I'm developing some python scripts to implement an NNTP/WordPress 
>gateway, and I ran into unexpected behavior (and a less than helpful 
>error message) from inews.  INN is from the inn2-2.6.0-2 package through 
>apt on linux mint.
>
>Python's email.message module creates messages that (by default?  I 
>wasn't able to find a setting for this) terminate lines with \r\n 
>(CRLF).  Feeding those messages to 'inews -h -O' produces the error 
>message (from memory) "No space after colon in <the first line of the 
>article body>".

inews is not nntp just as sendmail is not smtp.  Both run inside your Unix
system and use the Unix \n line terminator.  If you were opening a TCP
connection to port 119 and issuing nntp commands, then you would use \r\n 
as RFC 3877 says.

In python3, email.message normally uses \n line terminators unless you
tell it to use the email.policy.SMTP or email.policy.SMTPUTF8 policy
option.  So don't do that.  If you're still using python2, this would
be a good time to upgrade.





-- 
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly
Technical Details
Message-ID: <s17ahp$2a8u$1@gal.iecc.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <s1715o$e99$1@dont-email.me>

Show Full Headers
Complete Article Headers
Message-ID: <s17ahp$2a8u$1@gal.iecc.com>
Subject: Re: INN/inews behavior on \r\n
Date: Thu, 25 Feb 2021 04:54:17 +0000
From: John Levine <johnl@taugh.com>
References: <s1715o$e99$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: Taughannock Networks
Injection-Date: Thu, 25 Feb 2021 04:54:17 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="76062"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <s1715o$e99$1@dont-email.me>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)