🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #71822

Re: NNTP posting headers...

#71822
From: John Smith
Date: Sat, 11 Jun 2005 04:01
139 lines
4357 bytes
... I should have mentioned, this attempts to post to a free usenet news 
server, and YES!, it does allow posting--news.excelonline.com


Warmest regards,
John

"John Smith" <assemblywizard@gmail.com> wrote in message 
news:7ktqe.4456$JY7.5146668@news.sisna.com...
> hlwU:
>
> Yes, here is a snippet which I am am using to try to debug this 
> sending of the posting headers--it ain't pretty at this point--the 
> file it reads the headers from will follow the code, at the bottom of 
> this post.
> // CODE FOLLOWS
> #include <windows.h>
> #include <winsock2.h>
> #include <stdio.h>
> #include <string.h>
> #include <conio.h>
>
>   WNDCLASS a;
>   HWND b;
>   MSG c;
>   int d;
>   char aa[100];
>   char bb[100];
>   WSAData ws;
>   SOCKET s;
>   struct sockaddr_in A;
>   int i, ii, ch;
>   long gg;
>   char cc[10000];
>   struct hostent *h;
>   char p[] = {'P', 'O', 'S', 'T', 13, 10};
>   char crlf[] = {13, 10, 0};
>   char end[] = {13,10, '.', 13, 10, 0};
>   char q[] = {'Q', 'U', 'I', 'T', 13, 10, 0};
>   char head[] = {'H', 'E', 'A', 'D', 13, 10};
>
> void getsocket(void);
> int snd(char* str);
> void list(void);
> int rcv(void);
> void debug(char*);
>
> void write()
>   {
>   FILE *f;
>   char s[1024];
>   int ctr;
>
>   f = fopen("head.txt", "r");
>   snd(p);
>   rcv();
>   while(!feof(f))
>      {
>      fgets(s, 1024, f);
>      s[(strlen(s) - 1)] = 0;
>      strcat(s, "\r\n");
>      snd(s);
>      printf(".%s", s);
>      }
>   snd(end);
>   rcv();
>   fclose(f);
>   }
>
>
> void main(void)
>   {
>   getsocket();
>   rcv();
>   write();
>   ch = getch();
>   }
>
> void getsocket(void)
>   {
>   long gg;
>
>   gg = WSAStartup(0x0101,&ws);
>   printf("WSAStartup = %ld\n",gg);
>   s = socket(AF_INET,SOCK_STREAM,0);
>   printf("socket s = %ld\n",s);
>   A.sin_family = AF_INET;
>   A.sin_port = htons(119);
>   h = gethostbyname("news.excelonline.com");
>   printf("%s..\n",h->h_name);
>   A.sin_addr.s_addr = *(unsigned long *)h->h_addr_list[0];
>   d = connect(s,(struct sockaddr *)&A,sizeof(A));
>   printf("In Connect d = %ld\n",d);
>   }
>
> int snd(char* str)
>   {
>   return(send(s, str, strlen(str), 0));
>   }
>
> int rcv(void)
>   {
>   ii = recv(s, cc, sizeof(cc), 0);
>   cc[ii] = '\0';
>   printf(cc);
>   return(ii);
>   }
>
> void debug(char* s)
>   {
>   int ctr;
>
>   ctr = 0;
>   while(s[ctr] != (char)0)
>      {
>      if(s[ctr] < 14)
>         printf("%d-", s[ctr++]);
>      else
>         printf("%c", s[ctr++]);
>      }
>   printf("\n");
>   }
>
> |||||||| header data file (and msg) below |||||
> From: assemblywizard@gmail.com (assembly wizard)
> Path: com!gmail!assemblywizard
> Newsgroups: alt.test.testing
> Subject: newest test
> Message-ID: <999@gmail.com>
> Date: Fri, 19 Nov 82 16:14:55 GMT
> Organization: w.w.o.c.w.
>
> This is the message...
>
> .
>
> 

Technical Details
Message-ID: <Zmtqe.4477$V_7.5198016@news.sisna.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!news.sisna.com!not-for-mail
References: <W%pqe.2023$Q_3.4102173@news.sisna.com> <874qc53ex8.fsf@windlord.stanford.edu> <NSqqe.2929$DA5.4616216@news.sisna.com> <1118460352.bdf9cb8e357df309ac11eda932577499@teranews> <7ktqe.4456$JY7.5146668@news.sisna.com>

Show Full Headers
Complete Article Headers
Message-ID: <Zmtqe.4477$V_7.5198016@news.sisna.com>
Subject: Re: NNTP posting headers...
Date: Fri, 10 Jun 2005 21:01:59 -0700
From: "John Smith" <assemblywizard@gmail.com>
References: <W%pqe.2023$Q_3.4102173@news.sisna.com> <874qc53ex8.fsf@windlord.stanford.edu> <NSqqe.2929$DA5.4616216@news.sisna.com> <1118460352.bdf9cb8e357df309ac11eda932577499@teranews> <7ktqe.4456$JY7.5146668@news.sisna.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!news.sisna.com!not-for-mail
Reply-To: "John Smith" <assemblywizard@gmail.com>
Newsgroups: news.software.nntp
Lines: 139
Organization: W.W.O.C.W.
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 66.81.44.99
X-Complaints-To: newsabuse@ikano.com
X-Trace: news.sisna.com 1118462521 66.81.44.99 (Fri, 10 Jun 2005 22:02:01 MDT)
NNTP-Posting-Date: Fri, 10 Jun 2005 22:02:01 MDT
X-Received-Date: Fri, 10 Jun 2005 22:02:01 MDT (news.sisna.com)