From fe18ccc311721aff1401962f130e27c9172f6fba Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 9 Jun 2025 14:40:19 -0400 Subject: [PATCH] Need to hanlde email recipient sent status --- data-feed/feed01.tst | 5 ++++- lib/lvleml.c | 25 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/data-feed/feed01.tst b/data-feed/feed01.tst index 1234295..916ed36 100644 --- a/data-feed/feed01.tst +++ b/data-feed/feed01.tst @@ -13,12 +13,15 @@ S:RCPT TO: R:250 2.6.4 Address accepted S:RCPT TO: R:250 2.6.4 Address accepted +S:RCPT TO: +R:250 2.6.4 Address accepted #------------------------------------------------------------------------- #-sending data C:DATA D:Subject: Very Simple email contents D:From: Maitre Post D:To: Remote person +D:CC: Other person C:T D: D:FIRST Line @@ -33,6 +36,6 @@ D:end D:ligne court| C:. #------------------------------------------------------------------------- -R:250 3.5.3 Message accepted for delivery +R:250 3.5.3 Message accepted for delivery (Session... S:QUIT R:221 2.0.0 Bye, closing connection... diff --git a/lib/lvleml.c b/lib/lvleml.c index 32575d7..fed0a05 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -114,7 +114,7 @@ return done; /* Procedure to transmit a string to the remot peer*/ /* */ /********************************************************/ -static void transmit(CONTYP *contact,char *fmt,...) +static void transmit(CONTYP *contact,const char *fmt,...) { va_list args; @@ -345,12 +345,15 @@ static _Bool getdata(CONTYP *contact) _Bool done; FILE *queue; _Bool completed; +int total; +TIMESPEC start; int phase; _Bool proceed; done=false; queue=(FILE *)0; completed=false; +total=0; phase=0; proceed=setdirectives(contact,"tmp"); while (proceed==true) { @@ -360,11 +363,12 @@ while (proceed==true) { if ((queue=eml_createqfile(contact->cursesid,""))==(FILE *)0) phase=999; //trouble trouble break; - case 1 : //sending go ahaed to remote + case 1 : //adding received stamp to file if (addreceived(contact,queue)==false) phase=999; //trouble trouble break; - case 2 : //sending go ahaed to remote + case 2 : //sending 'go ahead' to remote + (void) clock_gettime(CLOCK_REALTIME,&start); (void) transmit(contact,"%d 3.5.0 %s", DATAOK,"End data with ."); break; @@ -379,6 +383,7 @@ while (proceed==true) { phase=999; //trouble trouble break; //exiting loop } + total+=got; if (strcmp(line,".")==0) { completed=true; } @@ -399,8 +404,16 @@ while (proceed==true) { phase=999; //Trouble trouble break; case 6 : //everything fine - (void) transmit(contact,"%d 3.5.3 %s", - CMDOK,"Message accepted for delivery"); + const char *fmt; + unsigned int delta; + + total+=1023; + total/=1024; //KBytes + delta=rou_getdifftime(&start); + fmt="%d 3.5.3 Message accepted for delivery (Session ID=<%s>)"; + (void) transmit(contact,fmt,CMDOK,contact->cursesid); + fmt="DATA stream received: %d Kbytes within %d.%03d seconds"; + (void) log_fprintlog(contact->logptr,false,fmt,total,delta/1000,delta%1000); done=true; proceed=false; //task done break; @@ -878,7 +891,7 @@ while (proceed==true) { sent+=1023; sent/=1024; //Sent now in KByes - fmt="Data Sent %d Kbytes within %d.%03d seconds"; + fmt="Data stream Sent: %d Kbytes within %d.%03d seconds"; delta=rou_getdifftime(&start); (void) log_fprintlog(rmt->logptr,false,fmt,sent,delta/1000,delta%1000); switch (rspcode) { -- 2.47.3