From 77639823a35dd28fdf21e75386284040f18478d5 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 19 May 2025 09:53:19 -0400 Subject: [PATCH] Removing data-queue content from git --- .gitignore | 1 + app/sender.c | 53 ++++++++++++++++++- app/sorter.c | 2 +- data-queue/24634-20250519065528-0893-0000 | 7 --- .../24634-20250519065528-0893-0000.trans | 4 -- data-queue/24643-20250519065530-0650-0000 | 7 --- .../24643-20250519065530-0650-0000.trans | 4 -- data-queue/24649-20250519065532-0284-0000 | 7 --- .../24649-20250519065532-0284-0000.trans | 4 -- data-queue/example.com-1747652224-0002.todo | 1 - .../subdom1.example.com-1747652224-0000.todo | 5 -- .../subdom2.example.com-1747652224-0001.todo | 6 --- lib/geseml.c | 2 +- lib/unieml.c | 6 ++- lib/unieml.h | 2 +- 15 files changed, 61 insertions(+), 50 deletions(-) delete mode 100644 data-queue/24634-20250519065528-0893-0000 delete mode 100644 data-queue/24634-20250519065528-0893-0000.trans delete mode 100644 data-queue/24643-20250519065530-0650-0000 delete mode 100644 data-queue/24643-20250519065530-0650-0000.trans delete mode 100644 data-queue/24649-20250519065532-0284-0000 delete mode 100644 data-queue/24649-20250519065532-0284-0000.trans delete mode 100644 data-queue/example.com-1747652224-0002.todo delete mode 100644 data-queue/subdom1.example.com-1747652224-0000.todo delete mode 100644 data-queue/subdom2.example.com-1747652224-0001.todo diff --git a/.gitignore b/.gitignore index e95ada7..ca7a379 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ test_area/ +data-feed/ *.swp lib/numver.h diff --git a/app/sender.c b/app/sender.c index 0efa306..6205182 100644 --- a/app/sender.c +++ b/app/sender.c @@ -22,6 +22,34 @@ #define SENDER "sender" //application name +/* + +*/ +/********************************************************/ +/* */ +/* procedure to dispatch email */ +/* */ +/********************************************************/ +static _Bool dispatcher(TRATYP **tra) + +{ +_Bool status; + +status=false; +if (tra!=(TRATYP **)0) { + TRATYP **ptr; + + ptr=tra; + while (*ptr!=(TRATYP *)0) { + (void) eml_dumptra((FILE *)0,*ptr); + ptr++; + } + } +return status; +} +/* + +*/ /********************************************************/ /* */ /* procedure to scan all files */ @@ -33,10 +61,14 @@ static _Bool scantodo(char *fname) #define OPEP "sorter.c:scantodo," _Bool status; +FILE *qfile; +TRATYP **tra; int phase; _Bool proceed; status=false; +qfile=(FILE *)0; +tra=(TRATYP **)0; phase=0; proceed=true; while (proceed==true) { @@ -48,8 +80,27 @@ while (proceed==true) { } break; case 1 : //Building the "trans" list + if ((qfile=eml_openqfile(fname,EXDOING))==(FILE *)0) { + (void) rou_alert(0,"%s Unable to open file <%s.%s>",OPEP,fname,EXDOING); + phase=999; //No need to go further + } + break; + case 2 : //reading the todo file + tra=eml_scanqfile(tra,qfile); + (void) eml_closeqfile(qfile); + if (tra!=(TRATYP **)0) { //No record found + (void) rou_alert(0,"%s No transport directive within <%s.%s> (Bug?)", + OPEP,fname,EXDOING); + phase=999; + } + break; + case 3 : //dispatching email + if (dispatcher(tra)==false) { //trouble backtracking file + (void)eml_renameqfile(fname,EXDONE,EXTODO); + phase=999; //No need to go further + } break; - case 2 : //job completed + case 4 : //job completed if (eml_renameqfile(fname,EXDOING,EXDONE)==false) { (void) rou_alert(0,"%s Unable to rename file <%s.%s>",OPEP,fname,EXDONE); phase=999; //No need to go further diff --git a/app/sorter.c b/app/sorter.c index c6a335e..0a3f5f0 100644 --- a/app/sorter.c +++ b/app/sorter.c @@ -57,7 +57,7 @@ while (proceed==true) { FILE *qfile; (void) rou_alert(0,"%s fame=<%s>",OPEP,*ptr); - if ((qfile=eml_openqfile(*ptr))!=(FILE *)0) { + if ((qfile=eml_openqfile(*ptr,(const char *)0))!=(FILE *)0) { trans=eml_scanqfile(trans,qfile); (void) eml_closeqfile(qfile); (void) eml_deleteqfile(*ptr); diff --git a/data-queue/24634-20250519065528-0893-0000 b/data-queue/24634-20250519065528-0893-0000 deleted file mode 100644 index da06980..0000000 --- a/data-queue/24634-20250519065528-0893-0000 +++ /dev/null @@ -1,7 +0,0 @@ -Subject: Very Simple email contents - -FIRST Line -SECOND Line -LAST Line - -. diff --git a/data-queue/24634-20250519065528-0893-0000.trans b/data-queue/24634-20250519065528-0893-0000.trans deleted file mode 100644 index e883f2c..0000000 --- a/data-queue/24634-20250519065528-0893-0000.trans +++ /dev/null @@ -1,4 +0,0 @@ -L 1747652129 0 24634-20250519065528-0893-0000 postmaster@example.com webmaster@example.com -R 1747652129 0 24634-20250519065528-0893-0000 postmaster@example.com dom1user1@subdom1.example.com -R 1747652129 0 24634-20250519065528-0893-0000 postmaster@example.com dom2user1@subdom2.example.com -R 1747652129 0 24634-20250519065528-0893-0000 postmaster@example.com dom2user2@subdom2.example.com diff --git a/data-queue/24643-20250519065530-0650-0000 b/data-queue/24643-20250519065530-0650-0000 deleted file mode 100644 index 5650b93..0000000 --- a/data-queue/24643-20250519065530-0650-0000 +++ /dev/null @@ -1,7 +0,0 @@ -Subject: Second email contents - -SECOND FIRST Line -SECOND SECOND Line -SECOND LAST Line - -. diff --git a/data-queue/24643-20250519065530-0650-0000.trans b/data-queue/24643-20250519065530-0650-0000.trans deleted file mode 100644 index 8b85ccd..0000000 --- a/data-queue/24643-20250519065530-0650-0000.trans +++ /dev/null @@ -1,4 +0,0 @@ -R 1747652131 0 24643-20250519065530-0650-0000 webmaster@example.com dom1user1@subdom1.example.com -R 1747652131 0 24643-20250519065530-0650-0000 webmaster@example.com dom1user2@subdom1.example.com -R 1747652131 0 24643-20250519065530-0650-0000 webmaster@example.com dom2user1@subdom2.example.com -R 1747652131 0 24643-20250519065530-0650-0000 webmaster@example.com dom2user2@subdom2.example.com diff --git a/data-queue/24649-20250519065532-0284-0000 b/data-queue/24649-20250519065532-0284-0000 deleted file mode 100644 index f4a7b86..0000000 --- a/data-queue/24649-20250519065532-0284-0000 +++ /dev/null @@ -1,7 +0,0 @@ -Subject: Third email contents - -THIRD FIRST Line -THIRD SECOND Line -THIRD LAST Line - -. diff --git a/data-queue/24649-20250519065532-0284-0000.trans b/data-queue/24649-20250519065532-0284-0000.trans deleted file mode 100644 index 5a54423..0000000 --- a/data-queue/24649-20250519065532-0284-0000.trans +++ /dev/null @@ -1,4 +0,0 @@ -R 1747652132 0 24649-20250519065532-0284-0000 noreply@example.com dom1user1@subdom1.example.com -R 1747652132 0 24649-20250519065532-0284-0000 noreply@example.com dom1user2@subdom1.example.com -R 1747652132 0 24649-20250519065532-0284-0000 noreply@example.com dom2user1@subdom2.example.com -R 1747652132 0 24649-20250519065532-0284-0000 noreply@example.com dom2user2@subdom2.example.com diff --git a/data-queue/example.com-1747652224-0002.todo b/data-queue/example.com-1747652224-0002.todo deleted file mode 100644 index 2e9bd5c..0000000 --- a/data-queue/example.com-1747652224-0002.todo +++ /dev/null @@ -1 +0,0 @@ -L,1747652129,0 24634-20250519065528-0893-0000 postmaster@example.com webmaster@example.com diff --git a/data-queue/subdom1.example.com-1747652224-0000.todo b/data-queue/subdom1.example.com-1747652224-0000.todo deleted file mode 100644 index 6f4e7ea..0000000 --- a/data-queue/subdom1.example.com-1747652224-0000.todo +++ /dev/null @@ -1,5 +0,0 @@ -R,1747652132,0 24649-20250519065532-0284-0000 noreply@example.com dom1user1@subdom1.example.com -R,1747652132,0 24649-20250519065532-0284-0000 noreply@example.com dom1user2@subdom1.example.com -R,1747652129,0 24634-20250519065528-0893-0000 postmaster@example.com dom1user1@subdom1.example.com -R,1747652131,0 24643-20250519065530-0650-0000 webmaster@example.com dom1user1@subdom1.example.com -R,1747652131,0 24643-20250519065530-0650-0000 webmaster@example.com dom1user2@subdom1.example.com diff --git a/data-queue/subdom2.example.com-1747652224-0001.todo b/data-queue/subdom2.example.com-1747652224-0001.todo deleted file mode 100644 index 4bf9286..0000000 --- a/data-queue/subdom2.example.com-1747652224-0001.todo +++ /dev/null @@ -1,6 +0,0 @@ -R,1747652132,0 24649-20250519065532-0284-0000 noreply@example.com dom2user1@subdom2.example.com -R,1747652132,0 24649-20250519065532-0284-0000 noreply@example.com dom2user2@subdom2.example.com -R,1747652129,0 24634-20250519065528-0893-0000 postmaster@example.com dom2user1@subdom2.example.com -R,1747652129,0 24634-20250519065528-0893-0000 postmaster@example.com dom2user2@subdom2.example.com -R,1747652131,0 24643-20250519065530-0650-0000 webmaster@example.com dom2user1@subdom2.example.com -R,1747652131,0 24643-20250519065530-0650-0000 webmaster@example.com dom2user2@subdom2.example.com diff --git a/lib/geseml.c b/lib/geseml.c index 2564fda..2cf65de 100644 --- a/lib/geseml.c +++ b/lib/geseml.c @@ -122,7 +122,7 @@ char line[300]; (void) strcpy(line,"Empty"); if (tra!=(TRATYP *)0) { - (void) snprintf(line,sizeof(line),"%c,%lu,%u %s %s %s", + (void) snprintf(line,sizeof(line),"%c %lu %u %s %s %s", tra->code, tra->date, tra->delay, diff --git a/lib/unieml.c b/lib/unieml.c index f93f161..92c5942 100644 --- a/lib/unieml.c +++ b/lib/unieml.c @@ -438,7 +438,7 @@ return dnames; /* directory. */ /* */ /********************************************************/ -PUBLIC FILE *eml_openqfile(char *qfilename) +PUBLIC FILE *eml_openqfile(char *qfilename,const char *ext) { #define OPEP "unieml.c:eml_openqfile," @@ -450,6 +450,10 @@ char fullname[300]; qfile=(FILE *)0; dirname=rou_apppath(QDIR); (void) snprintf(fullname,sizeof(fullname),"%s/%s",dirname,qfilename); +if ((ext!=(const char *)0)&&((strlen(fullname)+strlen(ext)+3) (error-<%s> bug?)", OPEP,fullname,strerror(errno)); diff --git a/lib/unieml.h b/lib/unieml.h index 5ed8f8a..213b142 100644 --- a/lib/unieml.h +++ b/lib/unieml.h @@ -86,7 +86,7 @@ extern int eml_closeqfile(FILE *qfile); extern char **eml_getqfilelist(char **dnames,char *ext); //procedure to open a specific qfile -extern FILE *eml_openqfile(char *qfilename); +extern FILE *eml_openqfile(char *qfilename,const char *ext); //procedure to check email address format //of an email address -- 2.47.3