bin-utils/feeder \
-f \
-d 2 \
- -c ./conf/feeder.conf.dvl \
+ -c ./conf/$(APPNAME).conf.dvl \
$(TESTIP) \
$(TESTPORT) \
- $(DATATST)/$(ONEFEED)
+ ./$(DATATST)/$(ONEFEED).tst
valfeed : debug #valgring of emlrcvr
@ echo "feed valgrind test"
static _Bool doconnect(FEEDTYP *fd)
{
+#define OPEP "feeder.c:doconnect"
+
_Bool isopen;
+int phase;
+_Bool proceed;
isopen=true;
-if (fd->socptr==(SOCPTR *)0)
- fd->socptr=soc_openfeedsock(pro_smtp,fd->srcip,fd->destip,fd->destport);
-if (fd->socptr==(SOCPTR *)0) {
- (void) rou_alert(0,"Unable to open link to [%s:%s]",fd->destip,fd->destport);
- isopen=false;
+phase=0;
+proceed=true;
+while (proceed==true) {
+ //(void) rou_alert(0,"%s JMPDBG phase='%d'",OPEP,phase);
+ switch (phase) {
+ case 0 : //is the connection really open
+ if (fd->socptr==(SOCPTR *)0) {
+ fd->socptr=soc_openfeedsock(pro_smtp,fd->srcip,fd->destip,fd->destport);
+ if (fd->socptr==(SOCPTR *)0) {
+ (void) rou_alert(0,"%s Unable to open link to [%s:%s]",
+ OPEP,fd->destip,fd->destport);
+ isopen=false;
+ phase=999;
+ }
+ }
+ break;
+ case 1 : //is the connect really open
+ (void) usleep(100000); //let wait form remote disconnect
+ if (soc_waitforchar(fd->socptr,10*1000)>=0) {
+ phase=999; //Yes no need to go further
+ }
+ break;
+ case 2 : //the remote just disconnect
+ fd->socptr=soc_closefeedsock(fd->socptr); //let clean the link
+ fd->socptr=soc_openfeedsock(pro_smtp,fd->srcip,fd->destip,fd->destport);
+ if (soc_waitforchar(fd->socptr,10*1000)<0) {
+ (void) rou_alert(0,"%s Unable to re-open link to [%s:%s]",
+ OPEP,fd->destip,fd->destport);
+ isopen=false;
+ phase=999;
+ }
+ break;
+ default : //SAFE Guard
+ proceed=false;
+ break;
+ }
+ phase++;
}
return isopen;
+
+#undef OPEP
}
/*
^L
switch (action) {
case 'R' : //wait Receiving line
case 'S' : //Sending line
- if (doconnect(fd)==false) {
- status=false;
- phase=999; //Not Connected!
- }
break;
default : //Nothing to do
break;
#====================================================
C:COMMENT STOP
T:(feed000) Sending a very Simple Email with ONE local delivery
+C:CONNECT
R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
#====================================================
S:HELO example.com
#====================================================
T:(feed001) Sending a a simple mail to remote server
+C:CONNECT
R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
#====================================================
S:EHLO example.com
T:(feed002) Sending a very Simple Email to 2 domains
+C:CONNECT
R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
#====================================================
S:HELO example.com
T:(feed003) Sending two email within the same session
+C:CONNECT
R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
#=========================================================================
S:HELO example.com
T:(feed004) Email using UTF-8 characters on local delivery
+C:CONNECT
R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
#====================================================
S:HELO example.com
--- /dev/null
+#====================================================
+T:(feed010) Testing if helo and ehlo fdqdn is OK
+C:CONNECT
+R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
+#====================================================
+S:HELO [129.219.254.34]
+R:501 5.5.4 HELO argument is mandatory, closing connection.
+#====================================================
+C:CONNECT
+R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
+S:EHLO domain
+R:501 5.5.4 syntax error (domain part missing), closing connection.
+#====================================================
+C:CONNECT
+R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
+S:EHLO 8.8.8.8
+R:501 5.5.4 syntax error (domain part missing), closing connection.
+#====================================================
+C:CONNECT
+R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
+S:EHLO [4.4.4.4]
+R:501 5.5.4 syntax error (domain part missing), closing connection.
+#====================================================
+C:CONNECT
+R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
+S:EHLO .com
+R:501 5.5.4 syntax error (domain part missing), closing connection.
+#====================================================
+C:CONNECT
+R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
+S:EHLO domain..com
+R:501 5.5.4 syntax error (domain part missing), closing connection.
+#====================================================
+++ /dev/null
-#very simple test to feed SMTP server
-#====================================================
-T:(feedx11) Testing if helo fdqdn is OK
-R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
-#====================================================
-S:HELO [129.219.254.34]
-R:501 5.5.4 HELO argument is mandatory, closing connection.
-#-------------------------------------------------------------------------