]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to implement smtp session within database.
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 27 Jun 2025 18:54:28 +0000 (14:54 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 27 Jun 2025 18:54:28 +0000 (14:54 -0400)
lib/unisql.c
lib/unisql.h

index e2dd00575fb17e41d74ad233283f635362048392..a4f72051e22c4be84803b1e283e32831d38bcf0f 100644 (file)
@@ -113,6 +113,27 @@ return usr;
 /*
 \f
 */
+/********************************************************/
+/*                                                      */
+/*      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;
+}
+/*
+\f
+*/
 /************************************************/
 /*                                             */
 /*     Routine to check if string is properly  */
index 2f8bee983444bcf1e791e49b50017d0f22a61a5a..45fba33d4d0a65a52beca0fb700432cc9ba1f7cf 100644 (file)
@@ -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);