gih900@csc.anu.oz (Geoff Huston) (12/21/89)
+-+-+-+ Beginning of part 7 +-+-+-+
X! att_list[i].item_code = 0;
X! att_list[i].buffer_address = 0;
X! att_list[i].return_length_address = 0;
V! if (!((sts = mail$send_add_address(&context,att_list,null_list)) & 1))
X `123
X! mail$send_end(&context,null_list,null_list);
X! nosysprv();
X! clear_err_line();
X! return(sts);
X! `125
X `125
X `032
X i = 0;
X**************
X*** 182,189
X no_broad_trap();
X smg$end_pasteboard_update(&pid);
X `125
X! sprintf(mail_cmd,"MAIL/NOEDIT %s/SUBJECT=\"%s\" %s",
X! file,quotes(subject),address);
X lib$spawn(c$dsc(mail_cmd),0,0,0,0,0,0,0,0,0,0,0);
X if (screen_active) `123
X smg$begin_pasteboard_update(&pid);
X--- 219,226 -----
X no_broad_trap();
X smg$end_pasteboard_update(&pid);
X `125
X! sprintf(mail_cmd,"MAIL/NOEDIT%s %s/SUBJECT=\"%s\" %s",
V! (mail_self_flag ? "/SELF" : "/NOSELF"),file,quotes(subject),addre
Xss);
X lib$spawn(c$dsc(mail_cmd),0,0,0,0,0,0,0,0,0,0,0);
X if (screen_active) `123
X smg$begin_pasteboard_update(&pid);
X**************
X*** 207,214
X do `123
X if (cp2 = strchr(cp1,',')) *cp2++ = '\0';
X util_cvrt(s,cp1);
X! if ((g = ga_exact_name(s))
X! && (!(ga[g]->grp_flags & NEWS_M_LOCAL)))
X return(0);
X `125 while (cp1 = cp2);
X return(1);
X--- 244,252 -----
X do `123
X if (cp2 = strchr(cp1,',')) *cp2++ = '\0';
X util_cvrt(s,cp1);
X! if ( (g = ga_exact_name(s))
X! && ( !(ga[g]->grp_flags & NEWS_M_LOCAL)
X! `124`124 (ga[g]->grp_flags & NEWS_M_MAILLIST)))
X return(0);
X `125 while (cp1 = cp2);
X return(1);
X**************
X*** 220,226
X * Parse the newsgroup specification, building a comma separated list.
X */ `032
X `032
X! parse_newsgroups(newslist,dflt,ask,use_aliases)
X char *newslist, *dflt;
X int ask, use_aliases;
X `123
X--- 258,264 -----
X * Parse the newsgroup specification, building a comma separated list.
X */ `032
X `032
X! parse_newsgroups(newslist,dflt,ask,use_aliases,auth_check)
X char *newslist, *dflt;
X int ask, use_aliases, auth_check;
X `123
X**************
X*** 222,228
X `032
X parse_newsgroups(newslist,dflt,ask,use_aliases)
X char *newslist, *dflt;
X! int ask, use_aliases;
X `123
X char newsgroups[256];
X short newsgroups_len;
X--- 260,266 -----
X `032
X parse_newsgroups(newslist,dflt,ask,use_aliases,auth_check)
X char *newslist, *dflt;
X! int ask, use_aliases, auth_check;
X `123
X char newsgroups[256];
X short newsgroups_len;
X**************
X*** 236,242
X if (status == RMS$_EOF) longjmp(env,2);
X newsgroups[newsgroups_len] = '\0';
X if (use_aliases) strcpy(newsgroups,aliases(newsgroups));
X! auth_list(newsgroups);
X strcpy(newslist,newsgroups);
X `125
X else `123
X--- 274,280 -----
X if (status == RMS$_EOF) longjmp(env,2);
X newsgroups[newsgroups_len] = '\0';
X if (use_aliases) strcpy(newsgroups,aliases(newsgroups));
X! if (auth_check) auth_list(newsgroups);
X strcpy(newslist,newsgroups);
X `125
X else `123
X**************
X*** 244,250
X do `123
X newsgroups[newsgroups_len] = '\0';
X if (use_aliases) strcpy(newsgroups,aliases(newsgroups));
X! if (auth_list(newsgroups)) `123
X strcat(newslist,newsgroups);
X strcat(newslist,",");
X `125
X--- 282,288 -----
X do `123
X newsgroups[newsgroups_len] = '\0';
X if (use_aliases) strcpy(newsgroups,aliases(newsgroups));
X! if (!auth_check `124`124 auth_list(newsgroups)) `123
X strcat(newslist,newsgroups);
X strcat(newslist,",");
X `125
X**************
X*** 302,309
X * post a new news item
X */
X `032
X! do_posting(postfile)
X! int postfile;
X `123
X char ngroup[512],
X post_dist[132], post_path[132],
X--- 340,348 -----
X * post a new news item
X */
X `032
X! static
X! do_posting(postfile,crosspost)
X! int postfile, crosspost;
X `123
X char ngroup[512],
X post_dist[132], post_path[132],
X**************
X*** 313,318
X xfrbuf[512],
X *cp1, *cp2,
X distribution[512], id[256], from[256], follow_groups[512],
V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25
X6],
X mod_address[132], post_address[256],
X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X--- 352,358 -----
X xfrbuf[512],
X *cp1, *cp2,
X distribution[512], id[256], from[256], follow_groups[512],
X+ xnewsgroups[512], xfollowgroups[512],
V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25
X6],
X mod_address[132], post_address[256], control_val[256],
X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X**************
X*** 314,320
X *cp1, *cp2,
X distribution[512], id[256], from[256], follow_groups[512],
V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25
X6],
X! mod_address[132], post_address[256],
X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X int approval_required = 0,
X fd,
X--- 354,360 -----
X distribution[512], id[256], from[256], follow_groups[512],
X xnewsgroups[512], xfollowgroups[512],
V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25
X6],
X! mod_address[132], post_address[256], control_val[256],
X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X int approval_required = 0,
X add_approved = 1,
X**************
X*** 317,322
X mod_address[132], post_address[256],
X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X int approval_required = 0,
X fd,
X g,
X use_default = 1,
X--- 357,363 -----
X mod_address[132], post_address[256], control_val[256],
X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X int approval_required = 0,
X+ add_approved = 1,
X fd,
X g,
X use_default = 1,
X**************
X*** 336,342
X $DESCRIPTOR(infile_dsc,infile);
X `032
X itm_approved = 0;
X! *post_dist = *follow_groups = *followup_groups = '\0';
X `032
X if (cli$present(c$dsc("HEADERS")) & 1) use_default = 0;
X mail_self = (cli$present(c$dsc("SELF")) & 1);
X--- 377,383 -----
X $DESCRIPTOR(infile_dsc,infile);
X `032
X itm_approved = 0;
V! *post_dist = *follow_groups = *followup_groups = *xnewsgroups = *xfollowg
Xroups = '\0';
X `032
X if (crosspost) `123
X use_default = 1;
X**************
X*** 338,346
X itm_approved = 0;
X *post_dist = *follow_groups = *followup_groups = '\0';
X `032
X! if (cli$present(c$dsc("HEADERS")) & 1) use_default = 0;
X! mail_self = (cli$present(c$dsc("SELF")) & 1);
X! edit_switch = (cli$present(c$dsc("EDIT")) & 1);
X `032
X if (postfile) `123
X if (cli$present(c$dsc("CONTROL")) & 1) `123
X--- 379,395 -----
X itm_approved = 0;
V *post_dist = *follow_groups = *followup_groups = *xnewsgroups = *xfollowg
Xroups = '\0';
X `032
X! if (crosspost) `123
X! use_default = 1;
X! mail_self = 0;
X! edit_switch = 0;
X! postfile = 0;
X! `125
X! else `123
X! if (cli$present(c$dsc("HEADERS")) & 1) use_default = 0;
X! mail_self = (cli$present(c$dsc("SELF")) & 1);
X! edit_switch = (cli$present(c$dsc("EDIT")) & 1);
X! `125
X `032
X if (postfile) `123
X if (cli$present(c$dsc("CONTROL")) & 1) `123
X**************
X*** 346,351
X if (cli$present(c$dsc("CONTROL")) & 1) `123
V if (no_priv()) return(err_line("\tError: Post - No privs for Control
X message generation\n"),0);
X control_switch = 1;
X `125
X `032
V if (cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) == CLI$_ABSE
XNT) *infile = '\0';
X--- 395,415 -----
X if (cli$present(c$dsc("CONTROL")) & 1) `123
V if (no_priv()) return(err_line("\tError: Post - No privs for Control
X message generation\n"),0);
X control_switch = 1;
X+ if (!(cli$get_value(c$dsc("CONTROL"),&infile_dsc,&infile_len) & 1))
X+ get_input(&infile_dsc,c$dsc("Control: "),&infile_len);
X+ infile[infile_len] = '\0';
X+ if (!infile_len)`032
V+ return(err_line("\tError: Post/Control - No control message entered
X\n"),0);
X+ strcpy(control_val,infile);
X+ sprintf(err_oline,"Add Approved: header to control posting [y]:");
X+ status = get_input(&command,c$dsc(err_oline),&response_length);
X+ if ((status == RMS$_EOF) `124`124 (status == SMG$_EOF))
X+ return(err_line("\tPost - Canceled\n"),0);
X+ if (!( (status & 1)
X+ && ( !response_length
X+ `124`124 ( response_length
X+ && (toupper(*response) == 'Y')))))
X+ add_approved = 0;
X `125
X `032
V if (cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) == CLI$_ABSE
XNT) *infile = '\0';
X**************
X*** 357,363
X s[s_len] = '\0';
X `125
X `032
X! parse_newsgroups(ngroup,((curr_g) ? ga[curr_g]->grp_name : ""),0,1);
X if (!*ngroup) `123
X err_line("\tError: Post - No Authorized Newsgroups specified\n");
X return(0);
X--- 421,427 -----
X s[s_len] = '\0';
X `125
X `032
X! parse_newsgroups(ngroup,((curr_g) ? ga[curr_g]->grp_name : ""),0,1,1);
X if (!*ngroup) `123
X err_line("\tError: Post - No Authorized Newsgroups specified\n");
X return(0);
X**************
X*** 399,406
X return(0);
X `125
X `032
X! extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X! if (!(cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) & 1))
X *infile = '\0';
X else infile[infile_len] = '\0';
X `032
X--- 463,470 -----
X return(0);
X `125
X `032
X! if (crosspost) `123
X! extract_orig = 1;
X *infile = '\0';
X `125
X else `123
X**************
X*** 402,412
X extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X if (!(cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) & 1))
X *infile = '\0';
X- else infile[infile_len] = '\0';
X-`032
X- if ((!*infile) && (!edit_switch)) `123
X- err_line("\tError: Post - no file to post\n");
X- return(0);
X `125
X `032
X fd = creat(Post_file,0,"rat=cr","rfm=var");
X--- 466,471 -----
X if (crosspost) `123
X extract_orig = 1;
X *infile = '\0';
X `125
X else `123
X extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X**************
X*** 408,413
X err_line("\tError: Post - no file to post\n");
X return(0);
X `125
X `032
X fd = creat(Post_file,0,"rat=cr","rfm=var");
X if ((fd == -1) `124`124 (!(fpw = fdopen(fd,"w")))) `123
X--- 467,482 -----
X extract_orig = 1;
X *infile = '\0';
X `125
X+ else `123
X+ extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X+ if (!(cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) & 1))
X+ *infile = '\0';
X+ else infile[infile_len] = '\0';
X+ if ((!*infile) && (!edit_switch)) `123
X+ err_line("\tError: Post - no file to post\n");
X+ return(0);
X+ `125
X+ `125
X `032
X fd = creat(Post_file,0,"rat=cr","rfm=var");
X if ((fd == -1) `124`124 (!(fpw = fdopen(fd,"w")))) `123
X**************
X*** 422,429
X while (fgets(xfrbuf,512,fpr)) `123
X if (header) `123
X if (extract_orig) `123
X! fputs(">",fpw);
X! if (*xfrbuf != '>') fputs(" ",fpw);
X fputs(xfrbuf,fpw);
X `125
X `125
X--- 491,500 -----
X while (fgets(xfrbuf,512,fpr)) `123
X if (header) `123
X if (extract_orig) `123
X! if (!crosspost) `123
X! fputs(">",fpw);
X! if (*xfrbuf != '>') fputs(" ",fpw);
X! `125
X fputs(xfrbuf,fpw);
X `125
X `125
X**************
X*** 441,447
X `125
X else if (!strncmp(xfrbuf,"Subject:",8)) `123
X strcpy(subj_line,"Subject: ");
V! if ((strncmp(&xfrbuf[9],"Re: ",4)) && (strncmp(&xfrbuf[9],"re: ",
X4))) strcat(subj_line,"Re: ");
X strcat(subj_line,&xfrbuf[9]);
X strcpy(s,&subj_line[9]);
X if (cp = strchr(s,'\n')) *cp = '\0';
X--- 512,520 -----
X `125
X else if (!strncmp(xfrbuf,"Subject:",8)) `123
X strcpy(subj_line,"Subject: ");
X! if ( !crosspost
X! && strncmp(&xfrbuf[9],"Re: ",4)
X! && strncmp(&xfrbuf[9],"re: ",4)) strcat(subj_line,"Re: ");
X strcat(subj_line,&xfrbuf[9]);
X strcpy(s,&subj_line[9]);
X if (cp = strchr(s,'\n')) *cp = '\0';
X**************
X*** 446,455
X strcpy(s,&subj_line[9]);
X if (cp = strchr(s,'\n')) *cp = '\0';
X `125
V! else if ((!strncmp(xfrbuf,"Newsgroups:",11)) && (!*follow_groups))
X `123
X! strcpy(follow_groups,&xfrbuf[12]);
X! if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X! s_to_lower(follow_groups);
X `125
X else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X strcpy(follow_groups,&xfrbuf[13]);
X--- 519,531 -----
X strcpy(s,&subj_line[9]);
X if (cp = strchr(s,'\n')) *cp = '\0';
X `125
X! else if (!strncmp(xfrbuf,"Newsgroups:",11)) `123
X! strcpy(xnewsgroups,&xfrbuf[12]);
X! if (!*follow_groups) `123
X! strcpy(follow_groups,&xfrbuf[12]);
X! if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X! s_to_lower(follow_groups);
X! `125
X `125
X else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X strcpy(follow_groups,&xfrbuf[13]);
X**************
X*** 453,458
X `125
X else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X strcpy(follow_groups,&xfrbuf[13]);
X if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X s_to_lower(follow_groups);
X strcpy(followup_groups,follow_groups);
X--- 529,535 -----
X `125
X else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X strcpy(follow_groups,&xfrbuf[13]);
X+ strcpy(xfollowgroups,follow_groups);
X if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X s_to_lower(follow_groups);
X strcpy(followup_groups,follow_groups);
X**************
X*** 456,462
X if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X s_to_lower(follow_groups);
X strcpy(followup_groups,follow_groups);
X! if (!strcmp(follow_groups,"poster")) `123
X fclose(fpr);
X if (*fp_open > 1) while (!delete(fp_open));
X *fp_open = '\0';
X--- 533,539 -----
X if (cp = strchr(follow_groups,'\n')) *cp = '\0';
-+-+-+-+-+ End of part 7 +-+-+-+-+-