@ bin/feeder \
-f \
-d 9 \
- -c ./conf/feeder.conf.dvl \
+ -c ./conf/$(APPNAME).conf.dvl \
$(TESTIP) \
$(TESTPORT) \
./$(DATATST)/feed01.tst
#file used to set environment configuration
#Used for developpement purpose ONLY
#------------------------------------------------
-#Defining Certificate
-CA_ROOT = "./certs/root-safe_CA.pem"
-CA_CERT = "./certs/mailleur_server-chain-cert_x509.pem"
-CA_KEY = "./certs/mailleur_server-key.pem"
+#Defining SERVER mode Certificate data
+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
#------------------------------------------------
+#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"
+#------------------------------------------------
#Configured for Postgresql database
DB_TYPE = POSTGRES
DB_NAME = mailleur
#====================================================
T:(feed01) Sending a a simple mail to remote server
-R:220 mailleur.example.com ESMTP (cleartext) emlrcvr...
+R:220 mailleur.example.com, ESMTP (cleartext) emlrcvr...
#====================================================
S:HELO example.com
#R:250-mailleur.example.com, link (cleartext) ready, your IP/FQDN=[127.127.0.2/feed2.example.com]
-R:250-mailleur.example.com, link (cleartext) ready,...
+R:250 mailleur.example.com, link (cleartext) ready,...
C:GOTLS
R:250 Link now encryp...
S:MAIL FROM: <postmaster@example.com>
(void) rou_alert(0,"%s Unable to exec process=<%s> (error=<%s> Bug?)",
OPEP,execpath,strerror(errno));
(void) rou_freestr(execpath);
- (void) system("ls -ails /home/jmp/safe-mailleur/mailleur/test_area/var/spool/mailleur/queue/");
(void) exit(-1);
}
break;
static void signon(CONTYP *contact)
{
-#define FMT "%d %s ESMTP (%s) %s-%s; %s"
+#define FMT "%d %s, ESMTP (%s) %s-%s; %s"
if (contact!=(CONTYP *)0) {
const char *mode;
if (suite==true)
sepa='-';
mode=soc_getstrmode(contact->socptr);
-(void) transmit(contact,"%d%c%s link (%s) ready, your IP/FQDN=[%s/%s]",
+(void) transmit(contact,"%d%c%s, link (%s) ready, your IP/FQDN=[%s/%s]",
CMDOK,sepa,contact->locname,mode,
contact->peerip,contact->peername);
}
/* Procedure to set the link certificate */
/* */
/********************************************************/
-static int set_crypting(TLSTYP *tls)
+static int set_crypting(TLSTYP *tls,_Bool server)
{
#define OPEP "unitls.c:set_crypting"
int done;
const char *certs[sizeof(cenv)/sizeof(char *)];
const SSL_METHOD *(*tls_methode)();
+const char *certext;
int mode;
int phase;
_Bool proceed;
done=false;
tls_methode=TLS_client_method;
-if (tls->server==true)
+certext="CLT";
+if (tls->server==true) {
tls_methode=TLS_server_method;
+ certext="SRV";
+ }
mode=SSL_VERIFY_NONE;
phase=0;
proceed=true;
switch (phase) {
case 0 : //loading certificate names
for (int i=0;i<(sizeof(cenv)/sizeof(char *));i++) {
- certs[i]=getenv(cenv[i]);
+ char data[100];
+
+ (void) snprintf(data,sizeof(data),"%s_%s",cenv[i],certext);
+ certs[i]=getenv(data);
+ (void) rou_alert(0,"%s JMPDBG certs[%d]=<%s>",OPEP,i,certs[i]);
if (certs[i]==(char *)0) {
(void) rou_alert(0,"%s Missing <%s> environment variable (config?)",
- OPEP,cenv[i]);
+ OPEP,data);
phase=999; //missing certificate info.
}
}
break;
}
phase++;
- }
+ }
return done;
+
#undef OPEP
}
/*
tls->server=server;
(void) getnames(tls);
break;
- case 1 : //set certificate
- if (set_crypting(tls)==false) {
+ case 1 : //set certificate according client/server mode
+ if (set_crypting(tls,server)==false) {
(void) rou_alert(1,"%s Unable to open a TLS channel",OPEP);
tls=freetls(tls);
phase=999;