- fprintf(temp,"N%s%c", nodebuf, 0);
- fprintf(temp,"H%s%c", frombuf, 0);
- if (dtype==REMOTE) {
- fprintf(temp,"D%s%c", destsys, 0);
- }
-
- if (strlen(recp) > 0) {
- fprintf(temp,"R%s%c", recp, 0);
- }
-
- /* Subject and text */
- if (strlen(subject)>0) {
- fprintf(temp,"U%s%c", subject, 0);
- }
- putc('M',temp);
- if (format_type == 4) {
- fprintf(temp, "Content-type: %s\n", content_type);
- if (extra_headers != NULL)
- fprintf(temp, "%s", extra_headers);
- fprintf(temp, "\n");
- }
- if (extra_headers != NULL) free(extra_headers);
- if (strcmp(buf, ".")) loopcopy(temp, stdin);
- putc(0,temp);
- fclose(temp);
- }
-
-
-void do_uudecode(char *target)
-{
- static char buf[1024];
- FILE *fp;
-
- snprintf(buf,sizeof buf,"cd %s; uudecode",target);
-
- fp=popen(buf,"w");
- if (fp==NULL) return;
- while (fgets(buf,1024,stdin)!=NULL) {
- fprintf(fp,"%s",buf);
- }
- pclose(fp);
-
- }
-
-int alias(char *name)
-{
- FILE *fp;
- int a;
- char abuf[256];
-
- fp=fopen(ALIASES,"r");
- if (fp==NULL) {
- syslog(LOG_ERR,"cannot open %s: %s",ALIASES,strerror(errno));
- return(2);
- }
-
- while (fgets(abuf,256,fp)!=NULL) {
- strip_trailing_whitespace(abuf);
- for (a=0; a<strlen(abuf); ++a) {
- if (abuf[a]==',') {
- abuf[a]=0;
- if (!strcasecmp(name,abuf)) {
- strcpy(name,&abuf[a+1]);
+ if (add_these_recipients) {
+ int num_recp_on_this_line;
+ char this_recp[256];
+
+ num_recp_on_this_line = num_tokens(add_these_recipients, ',');
+ for (i=0; i<num_recp_on_this_line; ++i) {
+ extract_token(this_recp, add_these_recipients,
+ i, ',', sizeof this_recp);
+ striplt(this_recp);
+ if (!IsEmptyStr(this_recp)) {
+ ++num_recipients;
+ recipients = realloc(recipients,
+ (num_recipients * sizeof (char *)));
+ recipients[num_recipients - 1] = strdup(this_recp);