S:QUIT
R:221 2.0.0 Bye, closing connection...
#-------------------------------------------------------------------------
+#prepare next test
+#waiting 1 sec
+C:WAIT 1
+#-restarting link
+C:RESTART
+R:220 mailleur.example.com ESMTP (cleartext) emlrcvr...
+S:MAIL FROM: <postmaster@example.com>
+R:250 2.1.3 postmaster@example.com.. sender ok
+S:RCPT TO: <postmaster@example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <postmaster@example.com>
+R:250 2.6.4 duplicate recipients will be consolidated
+S:RCPT TO: <webmaster@example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO:
+R:501 5.6.0 <> recipient not specified
+S:RCPT TO: <onlylocal>
+R:553 5.6.2 Missing domain part
+S:RCPT TO: <local:test@example.com>
+R:553 5.6.2 ':' not allowed in email
+#-------------------------------------------------------------------------
+S:QUIT
+R:221 2.0.0 Bye, closing connection...
R:250 2.1.3 postmaster@example.com.. sender ok
S:RCPT TO: <postmaster@example.com>
R:250 2.6.4 Address accepted
-S:RCPT TO: <postmaster@example.com>
-R:250 2.6.4 duplicate recipients will be consolidated
-S:RCPT TO: <webmaster@example.com>
+S:RCPT TO: <user1@sub1.example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user2@sub2.example.com>
R:250 2.6.4 Address accepted
-S:RCPT TO:
-R:501 5.6.0 <> recipient not specified
-S:RCPT TO: <onlylocal>
-R:553 5.6.2 Missing domain part
-S:RCPT TO: <local:test@example.com>
-R:553 5.6.2 ':' not allowed in email
#-------------------------------------------------------------------------
#-sending data
C:DATA
LAST Line
.
+#-------------------------------------------------------------------------
R:250 3.5.3 Message accepted for delivery
S:QUIT
R:221 2.0.0 Bye, closing connection...
+#-------------------------------------------------------------------------
+#prepare next test
+#waiting 1 sec
+C:WAIT 1
+#-restarting link
+C:RESTART
+R:220 mailleur.example.com ESMTP (cleartext) emlrcvr...
+S:MAIL FROM: <webmaster@example.com>
+R:250 2.1.3 webmaster@example.com.. sender ok
+S:RCPT TO: <postmaster@example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user1@sub1.example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user2@sub2.example.com>
+R:250 2.6.4 Address accepted
+#-------------------------------------------------------------------------
+#-sending data
+C:DATA
+Subject: Second email contents
+
+SECOND FIRST Line
+SECOND SECOND Line
+SECOND LAST Line
+
+.
+#-------------------------------------------------------------------------
+R:250 3.5.3 Message accepted for delivery
+S:QUIT
+#-------------------------------------------------------------------------
+#prepare next test
+#waiting 1 sec
+C:WAIT 1
+#-restarting link
+C:RESTART
+R:220 mailleur.example.com ESMTP (cleartext) emlrcvr...
+S:MAIL FROM: <noreply@example.com>
+R:250 2.1.3 noreply@example.com.. sender ok
+S:RCPT TO: <postmaster@example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user1@sub1.example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user2@sub2.example.com>
+R:250 2.6.4 Address accepted
+#-------------------------------------------------------------------------
+#-sending data
+C:DATA
+Subject: Third email contents
+
+THIRD FIRST Line
+THIRD SECOND Line
+THIRD LAST Line
+
+.
+#-------------------------------------------------------------------------
+R:250 3.5.3 Message accepted for delivery
+S:QUIT
R:250 2.1.3 postmaster@example.com.. sender ok
S:RCPT TO: <postmaster@example.com>
R:250 2.6.4 Address accepted
-S:RCPT TO: <postmaster@example.com>
-R:250 2.6.4 duplicate recipients will be consolidated
-S:RCPT TO: <webmaster@example.com>
+S:RCPT TO: <user1@sub1.example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user2@sub2.example.com>
R:250 2.6.4 Address accepted
-S:RCPT TO:
-R:501 5.6.0 <> recipient not specified
-S:RCPT TO: <onlylocal>
-R:553 5.6.2 Missing domain part
-S:RCPT TO: <local:test@example.com>
-R:553 5.6.2 ':' not allowed in email
#-------------------------------------------------------------------------
#-sending data
C:DATA
LAST Line
.
+#-------------------------------------------------------------------------
R:250 3.5.3 Message accepted for delivery
S:QUIT
R:221 2.0.0 Bye, closing connection...
+#-------------------------------------------------------------------------
+#prepare next test
+#waiting 1 sec
+C:WAIT 1
+#-restarting link
+C:RESTART
+R:220 mailleur.example.com ESMTP (cleartext) emlrcvr...
+S:MAIL FROM: <webmaster@example.com>
+R:250 2.1.3 webmaster@example.com.. sender ok
+S:RCPT TO: <postmaster@example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user1@sub1.example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user2@sub2.example.com>
+R:250 2.6.4 Address accepted
+#-------------------------------------------------------------------------
+#-sending data
+C:DATA
+Subject: Second email contents
+
+SECOND FIRST Line
+SECOND SECOND Line
+SECOND LAST Line
+
+.
+#-------------------------------------------------------------------------
+R:250 3.5.3 Message accepted for delivery
+S:QUIT
+#-------------------------------------------------------------------------
+#prepare next test
+#waiting 1 sec
+C:WAIT 1
+#-restarting link
+C:RESTART
+R:220 mailleur.example.com ESMTP (cleartext) emlrcvr...
+S:MAIL FROM: <noreply@example.com>
+R:250 2.1.3 noreply@example.com.. sender ok
+S:RCPT TO: <postmaster@example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user1@sub1.example.com>
+R:250 2.6.4 Address accepted
+S:RCPT TO: <user2@sub2.example.com>
+R:250 2.6.4 Address accepted
+#-------------------------------------------------------------------------
+#-sending data
+C:DATA
+Subject: Third email contents
+
+THIRD FIRST Line
+THIRD SECOND Line
+THIRD LAST Line
+
+.
+#-------------------------------------------------------------------------
+R:250 3.5.3 Message accepted for delivery
+S:QUIT
--- /dev/null
+R 1747141877 0 22941-20250513091116-0801-0000 postmaster@example.com postmaster@example.com
+R 1747141877 0 22941-20250513091116-0801-0000 postmaster@example.com user1@sub1.example.com
+R 1747141877 0 22941-20250513091116-0801-0000 postmaster@example.com user2@sub2.example.com
--- /dev/null
+Subject: Second email contents
+
+SECOND FIRST Line
+SECOND SECOND Line
+SECOND LAST Line
+
+.
--- /dev/null
+R 1747141878 0 22944-20250513091118-0476-0000 webmaster@example.com postmaster@example.com
+R 1747141878 0 22944-20250513091118-0476-0000 webmaster@example.com user1@sub1.example.com
+R 1747141878 0 22944-20250513091118-0476-0000 webmaster@example.com user2@sub2.example.com
--- /dev/null
+Subject: Third email contents
+
+THIRD FIRST Line
+THIRD SECOND Line
+THIRD LAST Line
+
+.
--- /dev/null
+R 1747141880 0 22947-20250513091120-0028-0000 noreply@example.com postmaster@example.com
+R 1747141880 0 22947-20250513091120-0028-0000 noreply@example.com user1@sub1.example.com
+R 1747141880 0 22947-20250513091120-0028-0000 noreply@example.com user2@sub2.example.com
+++ /dev/null
-R 1746921530 0 32616-20250510195843-0505-0000 postmaster@example.com postmaster@example.com
-R 1746921530 0 32616-20250510195843-0505-0000 postmaster@example.com webmaster@example.com
+++ /dev/null
-Subject: Very Simple email contents
-
-FIRST Line
-SECOND Line
-LAST Line
-
-.
+++ /dev/null
-R 1746921564 0 32665-20250510195917-0429-0000 postmaster@example.com postmaster@example.com
-R 1746921564 0 32665-20250510195917-0429-0000 postmaster@example.com webmaster@example.com
+++ /dev/null
-Subject: Very Simple email contents
-
-FIRST Line
-SECOND Line
-LAST Line
-
-.
+++ /dev/null
-R 1746921587 0 32713-20250510195939-0720-0000 postmaster@example.com postmaster@example.com
-R 1746921587 0 32713-20250510195939-0720-0000 postmaster@example.com webmaster@example.com
*/
/********************************************************/
/* */
+/* Procedure to remove a file from the queue */
+/* directory. */
+/* */
+/********************************************************/
+PUBLIC _Bool eml_deleteqfile(char *qfilename)
+
+{
+#define OPEP "unieml.c:eml_createqfile,"
+
+_Bool done;
+char *filename;
+char fpath[300];
+
+done=true;
+filename=rou_apppath(QDIR);
+(void) snprintf(fpath,sizeof(fpath),"%s/%s",filename,qfilename);
+if (unlink(fpath)<0) {
+ (void) rou_alert(0,"%s Unable to delete file <%s> (error=<%s>) (Bug?)",
+ OPEP,fpath,strerror(errno));
+ done=false;
+ }
+filename=rou_freestr(filename);
+return done;
+#undef OPEP
+}
+/*
+^L
+*/
+/********************************************************/
+/* */
/* Procedure to open a file within the queue */
/* directory. */
/* */
//remove CRLF from string
extern int eml_removecrlf(char *string);
+//procedure to delete a file within the queue
+extern _Bool eml_deleteqfile(char *qfilename);
+
//procedure to change qfile extension
extern _Bool eml_renameqfile(char *qfilename,char *oldext,char *newext);