]> SAFE projects GIT repository - jmp/mailleur/commitdiff
iattachement sequence seems to be working
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 13 Jun 2025 20:05:30 +0000 (16:05 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 13 Jun 2025 20:05:30 +0000 (16:05 -0400)
lib/geseml.c
lib/unieml.c
lib/unieml.h

index 2ce1289872080c2b8b2e8782fc3d1b0f68359753..c5c192f9adbcb1f2031065080c4fb302e0e99186 100644 (file)
@@ -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);
index 16df7ef1be4a58349be42c6b4ff3a9bf0a417892..4bccd247a1e15300fe3d83db1bdf4cc1e2d340fd 100644 (file)
@@ -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
 }
index 3a3c46423721268b0cb338996fcc1e35b8d60785..eaf2331162fa20cf19acaf217254aa1e7cd69616 100644 (file)
@@ -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