2.10.2: signatures in recmail.c
Chuq
chuqui at nsc.UUCP
Wed Aug 22 03:34:09 AEST 1984
This is a nice hack that causes recmail to append the .signature file to
your replies the same way inews does for followups.
chuq
------- recmail.c -------
*** /tmp/d07351 Tue Aug 21 10:32:23 1984
--- recmail.c Tue Aug 21 10:31:12 1984
***************
*** 33,38
char *mypath;
int goodcnt, badcnt;
char *mktemp(), *getenv();
tmpf = mktemp("/tmp/rmXXXXXX");
close(creat(tmpf,0666));
--- 33,41 -----
char *mypath;
int goodcnt, badcnt;
char *mktemp(), *getenv();
+ FILE *infp;
+ int c;
+ char bfr[BUFSIZ];
tmpf = mktemp("/tmp/rmXXXXXX");
close(creat(tmpf,0666));
***************
*** 49,54
strncmp(linebuf, "CC: ", 4) == 0)
addrecips(linebuf+4);
}
fclose(fd);
/*
--- 52,68 -----
strncmp(linebuf, "CC: ", 4) == 0)
addrecips(linebuf+4);
}
+ /* append the contents of the .signature file (if it exists) to
+ * the end of the mail message.
+ */
+ sprintf(bfr, "%s/%s", getenv("HOME"), ".signature");
+ if ((infp = fopen(bfr,"r")))
+ {
+ fprintf(fd,"---\n");
+ while ((c = getc(infp)) != EOF)
+ putc(c,fd);
+ fclose(infp);
+ }
fclose(fd);
/*
* Force the path to only consider /bin and /usr/bin, since
***************
*** 50,56
addrecips(linebuf+4);
}
fclose(fd);
-
/*
* Force the path to only consider /bin and /usr/bin, since
* that's the version of mail we want (not /usr/ucb/mail)
--- 64,69 -----
fclose(infp);
}
fclose(fd);
/*
* Force the path to only consider /bin and /usr/bin, since
* that's the version of mail we want (not /usr/ucb/mail)
--
>From the depths of the Crystal Cavern: Chuq Von Rospach
{amd,decwrl,fortune,hplabs,ihnp4}!nsc!chuqui nsc!chuqui at decwrl.ARPA
Dreams, dreams, enchanter! Gone with the harp's echo when the strings fall
mute; with the flame's shadow when the fire dies. Be still, and listen.
More information about the Comp.sources.unix
mailing list