From: Jean-Marc Pigeon (Delson) Date: Fri, 13 Jun 2025 20:05:30 +0000 (-0400) Subject: iattachement sequence seems to be working X-Git-Tag: tag-0.8~3 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=e2062a4d44e699a3933c3efd9d92314d74829fc9;p=jmp%2Fmailleur iattachement sequence seems to be working --- diff --git a/lib/geseml.c b/lib/geseml.c index 2ce1289..c5c192f 100644 --- a/lib/geseml.c +++ b/lib/geseml.c @@ -797,9 +797,6 @@ while (proceed==true) { (void) fprintf(qout,"To: <%s>\n",tra->mailfrom); (void) fprintf(qout,"Date: %s\n",rou_ascsysstamp(time((time_t *)0))); (void) fprintf(qout,"Subject: %s\n",*(tra->resp)+4); - (void) fprintf(qout,"\n"); - (void) fprintf(qout,"Bigre\n"); - (void) fprintf(qout,"Bigre\n"); break; case 2 : //attaching email itself done=eml_attache(qout,tra->sessid); diff --git a/lib/unieml.c b/lib/unieml.c index 16df7ef..4bccd24 100644 --- a/lib/unieml.c +++ b/lib/unieml.c @@ -820,11 +820,42 @@ return info; /* acceptable. */ /* */ /********************************************************/ -PUBLIC int eml_attache(FILE *fout,char *toaddfile) +PUBLIC int eml_attache(FILE *qout,char *toaddfile) { +#define OPEP "unieml.c:eml_attache," +#define CNT "Content-" + + int success; +char *marker; success=true; +marker="ABC123"; +//starting part +(void) fprintf(qout,"MIME-Version: 1.0\n"); +(void) fprintf(qout,"%sType: multipart/mixed; boundary=\"%s\"\n",CNT,marker); +(void) fprintf(qout,"\nThis is a multi-part message in MIME format.\n\n"); +(void) fprintf(qout,"--%s\n",marker); +(void) fprintf(qout,"%sType: text/plain; charset=\"iso-8859-1\"\n",CNT); +(void) fprintf(qout,"%sTransfer-Encoding: 8bit\n\n",CNT); + +//explain part +(void) fprintf(qout,"No comment\n"); + +//Middle part +(void) fprintf(qout,"--%s%s",marker,CRLF); +(void) fprintf(qout,"%sType: message/rfc822;\n\tname=\"%s\"\n",CNT,"ABC"); +(void) fprintf(qout,"%sTransfer-Encoding: 8bit\n",CNT); +(void) fprintf(qout,"%sDisposition: attachment;\n\tfilename=\"%s\"\n\n",CNT,"ABC"); + +//corps part +(void) fprintf(qout,"This is the corps\n"); + +//end part +(void) fprintf(qout,"\n--%s--\n\n",marker); return success; + +#undef CNT +#undef OPEP } diff --git a/lib/unieml.h b/lib/unieml.h index 3a3c464..eaf2331 100644 --- a/lib/unieml.h +++ b/lib/unieml.h @@ -113,6 +113,6 @@ extern int eml_countqfile(char *qfilename,int count); extern RCPTYP *eml_isemailok(char *email,char **report); //procedure to create an attachement for email data part. -extern int eml_attache(FILE *fout,char *toaddfile); +extern int eml_attache(FILE *qout,char *toaddfile); #endif