From: Jean-Marc Pigeon (Delson) Date: Fri, 27 Jun 2025 18:54:28 +0000 (-0400) Subject: Starting to implement smtp session within database. X-Git-Tag: tag-0.11~34 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=a4c102069e39a8e15e6e8c51f7e5850f1c00a72b;p=jmp%2Fmailleur Starting to implement smtp session within database. --- diff --git a/lib/unisql.c b/lib/unisql.c index e2dd005..a4f7205 100644 --- a/lib/unisql.c +++ b/lib/unisql.c @@ -113,6 +113,27 @@ return usr; /* */ +/********************************************************/ +/* */ +/* Procedure to free memory used by a usesion */ +/* definition. */ +/* */ +/********************************************************/ +PUBLIC SESTYP *sql_freeses(SESTYP *ses) + +{ +if (ses!=(SESTYP *)0) { + ses->efrom=rou_freestr(ses->efrom); + ses->sfrom=rou_freestr(ses->sfrom); + ses->sessid=rou_freestr(ses->sessid); + (void) free(ses); + ses=(SESTYP *)0; + } +return ses; +} +/* + +*/ /************************************************/ /* */ /* Routine to check if string is properly */ diff --git a/lib/unisql.h b/lib/unisql.h index 2f8bee9..45fba33 100644 --- a/lib/unisql.h +++ b/lib/unisql.h @@ -26,9 +26,21 @@ typedef struct { u_long mxspace; //user maximun space }USRTYP; +//structure about an email session +//A session is the exchaneg mail from, rcpts and data +//with a remote server +typedef struct { + char *sessid; //session id + char *sfrom; //the "mail from" comming from SMTP exchange + char *efrom; //the "mail from" as within the email itself + }SESTYP; + //procedure to free space used by an USRTYP extern USRTYP *sql_freeusr(USRTYP *usr); +//procedure to free memory used by a SESTYP +extern SESTYP *sql_freeses(SESTYP *ses); + //Procedure to check if string is properly coded according DB_LANG extern void sql_checkencoding(char *strencoded);