Subject: How to eliminate NNTP NOOPS from pine

From: [email-masked] (Jack Bryans)
Date: 28 Mar 1995 22:28:56 GMT

When used as a newsreader, pine shouts NOOP at the NNTP server every
2 1/2 minutes to circumvent the server's inactivity timeout policy.

INN defaults to a generous 2 hour inactivity timeout.  As I recall,
reference nntp has a similarly liberal timeout default.  That covers bnews,
cnews, and INN, the vast majority of newservers that don't need timeout
circumvention, and are ill served by it.  Users of the most popular
newsreaders rightfully wouldn't tolerate a server that required user action
every 2 1/2 minutes to prevent the delay of reconnection.  Pine's status as
a superb MUA doesn't qualify it for special dispensation as a newsreader.

In several comp.mail.pine followups in a thread started by my asking how to
build pine without NNTP NOOPs, Mark Crispin <[email-masked]> wrote:

> 5) NNTP is conspicuously the *only* protocol that lacks a no-op command.
>    Fortunately, unlike POP2, unknown command errors do not cause the
>    connection to die, so a client can issue a NOOP command and ignore
>    any error in the server's response.

Yeah, right.  There's no protocol associated with named and ntp, and I just
fell off the turnip truck.

> The only rational conclusion that one must make is that there is no such
> thing as a standard NNTP protocol.  Rather, each client and server
> implementor is on his own to build something that more or less
> interoperates with the maximal number of other implementation.

Yes NNTP is in disarray.  All the more reason for dialog between client
writer/maintainers and server writer/maintainers.  The widely recognized
client NNTP extensions came about either with the cooperation of server
writers, or by furnishing patches to reference nntp.  Unilateral protocol
extension isn't a positive contribution.

> More importantly, stating that "NOOP log events are filling up my disk"
> is an open broadcast to all crackers about how to commence a denial of
> service attack on your system.  The security implications are worse than
> just denial of service to users.  A cracker could cause denial of service
> to security logging mechanisms.  Just send a few hundred thousand bogus
> commands at the NNTP server until the disk fills, then crack away without
> fear of having evidence against you being logged.

The days of open NNTP servers have been over for years.

> By "active connection" you presumably mean "open connection", not
> "connection actively transferring data" -- inactivity timers have no
> effect upon the latter and thus it makes no sense to profer it as a
> solution to the latter "eating away at system resources".  Open but
> inactive TCP connections do not "eat away at system resources".  TCBs are
> not finite resources. 

Each newsreading connection takes a process slot and real and virtual
memory.  On our system these are finite resources.  Sure, one NNTP
connection that refuses to timeout is no big deal, but when you have
thousands of newsreading connections/day, inactivity timeouts are necessary
to keep the server responsive for all users.  The newsreaders I'm familiar
with reconnect to the server when the user resumes newsreading after a
timeout.

> Perhaps, but technically, timeouts are a violation of the TCP spec!  TCP is
> rather emphatic about this.  During a nuclear war, you do not want Clinton's
> telnet session to nuker.af.mil to be dropped just because a section of
> network in Ohio evaporated and it took a few minutes before another 747 with
> a cisco and microwave transceiver could be sent up to replace the lost line.

Then we're in good company with sendmail, ftp, and named.

> On the other hand, we provide source code.  If this is so important to
> you, why don't you write the code?

Fine.  Please add the following patch for the next release of pine.  It
defaults to present behavior for the minority that want it that way, but
provides a way for the rest of us to turn off NNTP NOOPs.

robin:/usr/local/src/pine3.91 53$ diff -c imap/ANSI/c-client/nntpcunx.c~ imap/ANSI/c-client/nntpcunx.c 
*** imap/ANSI/c-client/nntpcunx.c~      Sun Oct  9 17:59:29 1994
--- imap/ANSI/c-client/nntpcunx.c       Wed Feb 15 16:14:12 1995
***************
*** 782,788 ****
--- 782,792 ----
    /* Kludge alert: SMTPSOFTFATAL is 421 which is used in NNTP to mean ``No
     * next article in this group''.  Hopefully, no NNTP server will choke on
     * a bogus command. */
+ #ifdef NONOOP
+   return (1);
+ #else
    return (smtp_send (LOCAL->nntpstream,"NOOP",NIL) != SMTPSOFTFATAL);
+ #endif
  }

robin:/usr/local/src/pine3.91 54$ diff -c imap/ANSI/c-client/nntpcmac.c~ imap/ANSI/c-client/nntpcmac.c 
*** imap/ANSI/c-client/nntpcmac.c~      Sun Oct  9 17:55:21 1994
--- imap/ANSI/c-client/nntpcmac.c       Wed Feb 15 16:14:57 1995
***************
*** 783,789 ****
--- 783,793 ----
    /* Kludge alert: SMTPSOFTFATAL is 421 which is used in NNTP to mean ``No
     * next article in this group''.  Hopefully, no NNTP server will choke on
     * a bogus command. */
+ #ifdef NONOOP
+   return (1);
+ #else
    return (smtp_send (LOCAL->nntpstream,"NOOP",NIL) != SMTPSOFTFATAL);
+ #endif
  }

robin:/usr/local/src/pine3.91 55$ diff -c imap/ANSI/c-client/nntpcdos.c~ imap/ANSI/c-client/nntpcdos.c 
*** imap/ANSI/c-client/nntpcdos.c~      Sun Oct  9 17:54:30 1994
--- imap/ANSI/c-client/nntpcdos.c       Wed Feb 15 16:15:56 1995
***************
*** 849,855 ****
--- 849,859 ----
    /* Kludge alert: SMTPSOFTFATAL is 421 which is used in NNTP to mean ``No
     * next article in this group''.  Hopefully, no NNTP server will choke on
     * a bogus command. */
+ #ifdef NONOOP
+   return (1);
+ #else
    return (smtp_send (LOCAL->nntpstream,"NOOP",NIL) != SMTPSOFTFATAL);
+ #endif
  }

robin:/usr/local/src/pine3.91 56$ diff -c imap/ANSI/c-client/nntpcvms.c~ imap/ANSI/c-client/nntpcvms.c 
*** imap/ANSI/c-client/nntpcvms.c~      Sun Oct  9 17:55:55 1994
--- imap/ANSI/c-client/nntpcvms.c       Wed Feb 15 16:16:23 1995
***************
*** 787,793 ****
--- 787,797 ----
    /* Kludge alert: SMTPSOFTFATAL is 421 which is used in NNTP to mean ``No
     * next article in this group''.  Hopefully, no NNTP server will choke on
     * a bogus command. */
+ #ifdef NONOOP
+   return (1);
+ #else
    return (smtp_send (LOCAL->nntpstream,"NOOP",NIL) != SMTPSOFTFATAL);
+ #endif
  }

robin:/usr/local/src/pine3.91 57$ diff -c imap/non-ANSI/c-client/nntpcunx.c~ imap/non-ANSI/c-client/nntpcunx.c 
*** imap/non-ANSI/c-client/nntpcunx.c~  Sun Oct  9 18:01:53 1994
--- imap/non-ANSI/c-client/nntpcunx.c   Wed Feb 15 16:17:49 1995
***************
*** 838,844 ****
--- 838,848 ----
    /* Kludge alert: SMTPSOFTFATAL is 421 which is used in NNTP to mean ``No
     * next article in this group''.  Hopefully, no NNTP server will choke on
     * a bogus command. */
+ #ifdef NONOOP
+   return (1);
+ #else
    return (smtp_send (LOCAL->nntpstream,"NOOP",NIL) != SMTPSOFTFATAL);
+ #endif
  }

Jack