Article View: news.software.readers
Article #6052Re: trn: forward an article to other people
From: John Schmitz
Date: Wed, 29 Sep 1993 19:26
Date: Wed, 29 Sep 1993 19:26
147 lines
4870 bytes
4870 bytes
Re: forwarding in trn
> You could probably pipe it to mail, but I just hit `R' and
> then change the To: line.
This is true, but I find it cumbersome. I prefer the following
patch to make ^e be the forward key. This way I can customize the
quotes, subject and attribution independently of how I might reply.
*** /tmp/,RCSt1a07438 Wed Sep 29 12:17:34 1993
--- respond.c Tue Aug 24 14:36:41 1993
***************
*** 650,655
}
void
followup()
{
bool incl_body = (*buf == 'F');
--- 654,700 -----
void
+ forward()
+ {
+ char *maildoer = savestr(filexp(getval("MAILPOSTER",MAILPOSTER)));
+
+ artopen(art);
+ tmpfp = fopen(headname,"w"); /* open header file */
+ if (tmpfp == Nullfp) {
+ printf(cantcreate,headname) FLUSH;
+ goto no_forward;
+ }
+ interp(buf, (sizeof buf), getval("FORWMAILHEADER",FORWMAILHEADER));
+ fputs(buf,tmpfp);
+ if (!instr(maildoer,"%h",TRUE))
+ #ifdef VERBOSE
+ IF(verbose)
+ printf("\n%s\n(Above lines saved in file %s)\n",buf,headname)
+ FLUSH;
+ ELSE
+ #endif
+ #ifdef TERSE
+ printf("\n%s\n(Header in %s)\n",buf,headname) FLUSH;
+ #endif
+ if (artfp != Nullfp) {
+ interp(buf, (sizeof buf), getval("POSTERSAID",POSTERSAID));
+ fprintf(tmpfp,"%s\n",buf);
+ parseheader(art);
+ fseek(artfp,(long)htype[PAST_HEADER].ht_minpos,0);
+ while (fgets(buf,LBUFLEN,artfp) != Nullch) {
+ fprintf(tmpfp,"%s",buf);
+ }
+ fprintf(tmpfp,"\n");
+ }
+ fclose(tmpfp);
+ interp(cmd_buf, (sizeof cmd_buf), maildoer);
+ invoke(cmd_buf,origdir);
+ UNLINK(headname); /* kill the header file */
+ no_forward:
+ free(maildoer);
+ }
+
+ void
followup()
{
bool incl_body = (*buf == 'F');
*** /tmp/,RCSt1a07446 Wed Sep 29 12:18:40 1993
--- ng.c Tue Aug 24 14:36:38 1993
***************
*** 1086,1091
case 'f': { /* followup command */
followup();
forcegrow = TRUE; /* recalculate lastart */
return AS_ASK;
}
case '|':
--- 1097,1106 -----
case 'f': { /* followup command */
followup();
forcegrow = TRUE; /* recalculate lastart */
+ return AS_ASK;
+ }
+ case Ctl('e'): { /* reply? */
+ forward();
return AS_ASK;
}
case '|':
*** /tmp/,RCSt1a07456 Wed Sep 29 12:21:27 1993
--- common.h Tue Aug 24 14:44:10 1993
***************
*** 551,556
# endif
#endif
#ifndef YOUSAID /* % */
# define YOUSAID "In article %i you write:"
#endif
--- 570,593 -----
# endif
#endif
+ #ifdef INTERNET
+ # ifndef FORWMAILHEADER /* % */
+ # ifdef CONDSUB
+ # define FORWMAILHEADER "To: \nSubject: (fwd) Re: %S\n%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}\n)Newsgroups: %n\nIn-Reply-To: %i\n%(%[references]!=^$?References\\: %[references]\n)Organization: %o\nCc: \nBcc: \n\n"
+ # else
+ # define FORWMAILHEADER "To: \nSubject: (fwd) Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nCc: \nBcc: \n\n"
+ # endif
+ # endif
+ #else
+ # ifndef FORWMAILHEADER /* % */
+ # ifdef CONDSUB
+ # define MAILHEADER "To: \nSubject: (fwd) %(%i=^$?:Re: %S\nNewsgroups: %n\nIn-Reply-To: %i)\n%(%[references]!=^$?References\\: %[references]\n)Organization: %o\nCc: \nBcc: \n\n"
+ # else
+ # define FORWMAILHEADER "To: \nSubject: (fwd) Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nCc: \nBcc: \n\n"
+ # endif
+ # endif
+ #endif
+
#ifndef YOUSAID /* % */
# define YOUSAID "In article %i you write:"
#endif
***************
*** 555,560
# define YOUSAID "In article %i you write:"
#endif
/* command to submit a followup article */
#ifndef NEWSPOSTER /* % and ~ */
# define NEWSPOSTER "QUOTECHARS=%I Pnews -h %h"
--- 592,601 -----
# define YOUSAID "In article %i you write:"
#endif
+ #ifndef POSTERSAID /* % */
+ # define POSTERSAID "In article %i %f writes:"
+ #endif
+
/* command to submit a followup article */
#ifndef NEWSPOSTER /* % and ~ */
# define NEWSPOSTER "QUOTECHARS=%I Pnews -h %h"
Technical Details
Message-ID:
<28cngj$7a4@mentor5.scd.hp.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!spool.mu.edu!sdd.hp.com!hpscit.sc.hp.com!newsReferences:
<FANG.93Sep29143650@p-dwarf.oit.unc.edu> <28cm5v$s9h@bradley.bradley.edu>Show Full Headers
Complete Article Headers
Message-ID: <28cngj$7a4@mentor5.scd.hp.com> Subject: Re: trn: forward an article to other people Date: Wed, 29 Sep 1993 19:26:11 +0000 From: schmitz@scd.hp.com (John Schmitz) References: <FANG.93Sep29143650@p-dwarf.oit.unc.edu> <28cm5v$s9h@bradley.bradley.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!spool.mu.edu!sdd.hp.com!hpscit.sc.hp.com!news Newsgroups: news.software.readers Organization: Hewlett-Packard Lines: 147 NNTP-Posting-Host: mentor5.scd.hp.com