@ rm -fr $(TESTDIR)/var/spool/$(APPNAME)/queue/*
@ bin/feeder \
-f \
- -d 9 \
+ -d 2 \
-c ./conf/$(APPNAME).conf.dvl \
$(TESTIP) \
$(TESTPORT) \
@ openssl s_client \
-crlf \
--showcerts \
- -status \
- -msg \
- -debug \
-key certs/localhost-key.pem \
-cert certs/localhost-cert.pem \
-CAfile certs/root-safe_CA.pem \
#to kill all remaining emlrcvr process
killall :
@ - kill -HUP emlrcvr
+ @ - kill -9 sender
@ - kill -9 sorter
#--------------------------------------------------------------------
CA_ROOT_SRV = "./certs/root-safe_CA.pem"
CA_CERT_SRV = "./certs/mailleur_server-chain-cert_x509.pem"
CA_KEY_SRV = "./certs/mailleur_server-key.pem"
-CA_VERIFY = 1 #to check PEER certificat
+CA_VERIFY_SRV = 1 #to check PEER/client remote certificate
#------------------------------------------------
#Defining CLIENT mode Certificate data
CA_ROOT_CLT = "./certs/root-safe_CA.pem"
CA_CERT_CLT = "./certs/localhost-chain-cert.pem"
CA_KEY_CLT = "./certs/localhost-key.pem"
+CA_VERIFY_CLT = 0 #to check PEER/server remote certificate
#------------------------------------------------
#Configured for Postgresql database
DB_TYPE = POSTGRES
}
switch (status) {
case -1 : //polling error
+ (void) rou_alert(0,"%s Polling error (error=<%s>)",OPEP,strerror(errno));
break;
case 0 : //polling timeout
+ (void) rou_alert(0,"%s Polling timeout (error=<%s>)",OPEP,strerror(errno));
break;
case 1 : //polling early return (data or event)
//checking if link still available
+ //(void) rou_alert(0,"%s Polling early (error=<%s>)",OPEP,strerror(errno));
if (tls_write(soc->tls,(char *)0,0)<0) {
(void) rou_alert(0,"%s, TLS link disconnect detected",OPEP);
status=0;
}
break;
default :
+ (void) rou_alert(0,"%s Polling default (error=<%s>)",OPEP,strerror(errno));
break;
}
}
PUBLIC int tcp_get_smtp_reply(RMTTYP *rmt,int wait)
{
+#define OPEP "gestcp.c:cp_get_smtp_reply,"
+
int code;
int maxlines;
code=ERRPROC;
maxlines=20; //maximun number of line error
+if (debug>0)
+ wait/=10; //debug mode not waiting form long
while (maxlines>0) {
char *line;
int sofar;
line=(char *)0;
+ (void) rou_alert(0,"%s JMPDBG waiting for answer",OPEP);
if (tcp_getline(rmt->socptr,wait,&line)<0) {
char cmt[100];
+ (void) rou_alert(0,"%s JMPDBG timeout",OPEP);
(void) snprintf(cmt,sizeof(cmt),"%d Timeout waiting '%d' sec for MX <%s>",
ERRPROC,wait,rmt->curmx->mxname);
line=strdup(cmt);
maxlines--;
}
return code;
+
+#undef OPEP
}
/*
^L
rspcode=tcp_smtp_command(rmt,"STARTTLS",rmt->orgdomain);
switch (rspcode) {
case SIGNON : //link is now encrypted
- debug=9;
+ int bigre;
(void) usleep(100000);
done=soc_starttls(rmt->socptr,false);
(void) rou_alert(0,"%s JMPDBG should start tls done='%d'",OPEP,done);
+ bigre=tcp_get_smtp_reply(rmt,WAITRMT);
+ (void) rou_alert(0,"%s JMPDBG tls done='%d'",OPEP,bigre);
break;
default : //Trouble
(void) rou_alert(0,"%s Unable to establish crypted link with <%s>",
*ptr='\000';
if ((ptr=strrchr(line,'\n'))!=(char *)0)
*ptr='\000';
+ //cleaning the end of line
+ if (strlen(line)>0) {
+ ptr=line+strlen(line)-1;
+ while (*ptr!='\000') {
+ if ((*ptr!=' ')&&(*ptr!='\t'))
+ break;
+ *ptr='\000';
+ ptr--;
+ }
+ }
+ //check remaining clean line
if (strlen(line)==0)
phase=0; //next line
break;
{
#define OPEP "unitls.c:set_crypting"
-static const char *cenv[]={"CA_KEY","CA_CERT","CA_ROOT"};
-static const char *envver="CA_VERIFY";
+static const char *cenv[]={"CA_KEY","CA_CERT","CA_ROOT","CA_VERIFY"};
int done;
const char *certs[sizeof(cenv)/sizeof(char *)];
phase=999; //missing certificate info.
}
}
- if (getenv(envver)!=(char *)0) { //env value can be missing
- if (atoi(getenv(envver))!=0) {
+ //Set the verify mode
+ if (certs[3]!=(char *)0) { //env value can be missing
+ if (atoi(certs[3])==1) {
+ (void) rou_alert(0,"%s JMPDBG verifiyng certificate",OPEP);
mode=SSL_VERIFY_PEER; //to make sure peer certificate is OK
}
}
}
break;
case 2 : //lets wait for char
+ (void) rou_alert(0,"%s JMPDBG waiting %d millisec",OPEP,millisec);
status=poll(polling,1,millisec);
switch (status) {
case -1 : //Polling error
- (void) rou_alert(0,"%s Polling error (error=<%s>",OPEP,strerror(errno));
+ (void) rou_alert(0,"%s Polling error (error=<%s>)",OPEP,strerror(errno));
break;
case 0 : //polling time out
//nothing to do
+ (void) rou_alert(0,"%s Polling timeout (error=<%s>)",OPEP,strerror(errno));
break;
case 1 : //char is available.
//nothing to do