*/
/************************************************/
/* */
+/* Send transmission out */
+/* */
+/************************************************/
+static int sendout(SOCPTR *socptr,char *line)
+
+{
+int taille;
+
+taille=tcp_write(socptr,line);
+taille+=tcp_write(socptr,CRLF);
+return taille;
+}
+/*
+^L
+*/
+/************************************************/
+/* */
/* procedure to set feed scan in comment */
/* mode. */
/* */
//(void) rou_alert(0,"%s JMPDBG phase='%d'",OPEP,phase);
switch (phase) {
case 0 : //Transmit "DATA" to remote
- if (tcp_write(fd->socptr,action)!=(strlen(action)+2))
+ if (sendout(fd->socptr,action)!=(strlen(action)+2))
phase=999; //Unable to send STARTTLS sequence
break;
case 1 : //Get DATA command status
if (data[2]=='.') {
(void) memmove(data+3,data+2,strlen(data+2));
}
- (void) tcp_write(fd->socptr,data+2);
+ (void) sendout(fd->socptr,data+2);
break;
case 'C' : //data marker
switch (data[2]) {
case '.' : //end of data marker
if (numdata>1) //could be empty data
- (void) tcp_write(fd->socptr,".");
+ (void) sendout(fd->socptr,".");
completed=true;
break;
case 'T' : //timer data
isnow=time((time_t *)0);
(void) snprintf(ed,sizeof(ed),"Date: %s",rou_ascsysstamp(isnow));
- (void) tcp_write(fd->socptr,ed);
+ (void) sendout(fd->socptr,ed);
break;
default : //unexpected data marker
(void) rou_alert(0,"%s Unexpected data marker <%s> (Bug?)",
static _Bool gomodetls(SOCPTR *socptr)
{
+#define OPEP "feeder.c:gomodetls,"
_Bool status;
char *got;
phase=0;
proceed=true;
while (proceed==true) {
+ //(void) rou_alert(0,"%s JMPDBG phase='%d' status='%d'",OPEP,phase,status);
switch (phase) {
case 0 : //Sending START TLS command
- if (tcp_write(socptr,action)!=(strlen(action)+2))
+ if (sendout(socptr,action)!=(strlen(action)+2))
phase=999; //Unable to send STARTTLS sequence
break;
case 1 : //Get STARTTLS command status
phase++;
}
return status;
+
+#undef OPEP
}
/*
^L
status=doincoming(fd->socptr,*numline,line);
break;
case 'S' : //sending data
- (void) tcp_write(fd->socptr,line);
- (void) tcp_write(fd->socptr,CRLF);
+ (void) sendout(fd->socptr,line);
break;
case 'T' : //Get the test titre
status=strncpy(testname,line,sizeof(testname));
T:(feed01) Sending a a simple mail to remote server
R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
#====================================================
-S:HELO example.com
+S:EHLO 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,...
+R:250-SIZE 52428800
+R:250-STARTTLS
+R:250-8BITMIME
+R:250-ENHANCEDSTATUSCODES
+R:250 AUTH PLAIN LOGIN
C:GOTLS
-R:250 Link now encryp...
+C:WAIT 1
+S:EHLO example.com
+R:250-mailleur.example.com, link (crypted) ready,...
+R:250-SIZE 52428800
+R:250-8BITMIME
+R:250-ENHANCEDSTATUSCODES
+R:250 AUTH PLAIN LOGIN
S:MAIL FROM: <postmaster@example.com>
R:250 2.1.3 postmaster@example.com.. sender ok
S:RCPT TO: <dom1user1@mailref1.example.com>
-R:250 2.6.4 Address accepted
+R:250 2.6.4 Address accepted <dom1user1@mailref1.example.com>
S:RCPT TO: <dom1user2@mailref1.example.com>
-R:250 2.6.4 Address accepted
+R:250 2.6.4 Address accepted <dom1user2@mailref1.example.com>
#-------------------------------------------------------------------------
#-sending data
C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
D:ligne court|
C:.
#-------------------------------------------------------------------------
-R:250 3.5.3 Message accepted for delivery (Session...
+R:250-3.5.3 Session ID=<...
+R:250-3.5.3 data stream received:...
+R:250 3.5.3 Message accepted for delivery
S:QUIT
R:221 2.0.0 Bye, closing connection...
contact->transout=tcp_addline(contact->transout,line);
}
if (flush==true) {
- (void) rou_alert(0,"JMPDBG trans=<%s>",contact->transout);
(void) tcp_write(contact->socptr,contact->transout);
contact->transout=rou_freestr(contact->transout);
}
total+=1023;
total/=1024; //KBytes
delta=rou_getdifftime(&start);
- fmt="%d 3.5.3 Message accepted for delivery (Session ID=<%s>)";
+ fmt="%d-3.5.3 Session ID=<%s>";
+ (void) transmit(contact,false,fmt,CMDOK,contact->cursesid);
+ fmt="%d-3.5.3 data stream received: %d Kbytes within %d.%03d seconds)";
+ (void) transmit(contact,false,fmt,CMDOK,total,delta/1000,delta%1000);
+ fmt="%d 3.5.3 Message accepted for delivery";
(void) transmit(contact,true,fmt,CMDOK,contact->cursesid);
- fmt="(DATA stream received: %d Kbytes within %d.%03d seconds)";
- (void) log_fprintlog(contact->logptr,false,fmt,total,delta/1000,delta%1000);
done=true;
proceed=false; //task done
break;