- }
- if ((b!='M')&&(b>0)) fpgetfield(fp,bbb);
- if (b=='I') tmid=atol(bbb);
- if (b=='N') {
- strcpy(tsid,bbb);
- if (!strcmp(tsid,NODENAME)) strcpy(tsid,FQDN);
- for (a=0; a<strlen(tuid); ++a) if (tuid[a]==' ') tuid[a]='_';
- fprintf(tfp,"From: %s@%s ",tuid,tsid);
- for (a=0; a<strlen(tuid); ++a) if (tuid[a]=='_') tuid[a]=' ';
- fprintf(tfp,"(%s)\n",tuid);
- }
- if (b=='P') fprintf(tfp,"Path: %s\n",bbb);
- if (b=='A') strcpy(tuid,bbb);
- if (b=='O') {
- xref(bbb,ngn);
- fprintf(tfp,"Newsgroups: %s\n",ngn);
- }
- if (b=='R') fprintf(tfp,"To: %s\n",bbb);
- if (b=='U') fprintf(tfp,"Subject: %s\n",bbb);
- if (b=='T') {
- now=atol(bbb);
- tm=(struct tm *)localtime(&now);
- fprintf(tfp,"Date: %s",asctime(tm));
- }
- } while ((b!='M')&&(b>0));
- msglen=ftell(tfp);
- fclose(tfp);
+ if ((b != 'M') && (b > 0))
+ fpgetfield(fp, bbb);
+ if (b == 'I')
+ tmid = atol(bbb);
+ if (b == 'N') {
+ strcpy(tsid, bbb);
+ if (!strcmp(tsid, NODENAME))
+ strcpy(tsid, FQDN);
+ for (a = 0; a < strlen(tuid); ++a)
+ if (tuid[a] == ' ')
+ tuid[a] = '_';
+ fprintf(tfp, "From: %s@%s ", tuid, tsid);
+ for (a = 0; a < strlen(tuid); ++a)
+ if (tuid[a] == '_')
+ tuid[a] = ' ';
+ fprintf(tfp, "(%s)\n", tuid);
+ }
+ if (b == 'P')
+ fprintf(tfp, "Path: %s\n", bbb);
+ if (b == 'A')
+ strcpy(tuid, bbb);
+ if (b == 'O') {
+ xref(bbb, ngn);
+ fprintf(tfp, "Newsgroups: %s\n", ngn);
+ }
+ if (b == 'R')
+ fprintf(tfp, "To: %s\n", bbb);
+ if (b == 'U')
+ fprintf(tfp, "Subject: %s\n", bbb);
+ if (b == 'T') {
+ now = atol(bbb);
+ tm = (struct tm *) localtime(&now);
+ fprintf(tfp, "Date: %s", asctime(tm));
+ }
+ } while ((b != 'M') && (b > 0));
+ msglen = ftell(tfp);