#-------------------------------------------------------------------------
S:HELO example.com
R:250 mailleur.example.com, link (cleartext) ready,...
-S:MAIL FROM: <trouble@mailref1.example.com>
-R:250 2.1.3 trouble@mailref1.example.com.. sender ok
+S:MAIL FROM: <postmaster@mailref1.example.com>
+R:250 2.1.3 postmaster@mailref1.example.com.. sender ok
S:RCPT TO: <user2@mailref1.example.com>
R:250 2.6.4 Address accepted <user2@mailref1.example.com>
S:RCPT TO: <user1@mailref1.example.com>
}
break;
case 1 : //Preparing attachement email
- (void) fprintf(qout,"From: %s Email daemon <%s>\n",APPNAME,orig);
+ (void) fprintf(qout,"%s%s Email daemon <%s>\n",EFROM,APPNAME,orig);
(void) fprintf(qout,"To: <%s>\n",tra->mailfrom);
(void) fprintf(qout,"Date: %s\n",rou_ascsysstamp(time((time_t *)0)));
(void) fprintf(qout,"Subject: %s\n",*(tra->resp)+4);
if (contact!=(CONTYP *)0) {
char *newsid;
- (void) freesessid(contact);
contact->session=(SESTYP *)calloc(1,sizeof(SESTYP));
newsid=eml_getcursesid(contact->mainsesid,contact->numreset);
contact->session=(SESTYP *)calloc(1,sizeof(SESTYP));
{
#define OPEP "lvleml.c:getdata,"
-#define EXTMP "tmp"
+#define EXTMP "tmp"
_Bool done;
FILE *queue;
+_Bool inheader;
_Bool completed;
u_long total;
TIMESPEC start;
done=false;
queue=(FILE *)0;
+inheader=true;
completed=false;
total=0;
phase=0;
break; //exiting loop
}
total+=got;
+ if (inheader==true) {
+ if (strlen(line)==0)
+ inheader=false;
+ else { //extracting the sfrom
+ int max;
+
+ max=strlen(EFROM);
+ if (strncasecmp(line,EFROM,max)==0) {
+ contact->session->efrom=rou_freestr(contact->session->efrom);
+ contact->session->efrom=strdup(line+max);
+ }
+ }
+ }
if (strcmp(line,".")==0) {
completed=true;
}
(void) transmit(contact,true,"%d-%s flushed session %s",
CMDOK,LOCSEQ,contact->session->sessid);
+(void) freesessid(contact);
contact->numreset++;
+(void) getsessid(contact);
contact->recipients=(RCPTYP **)rou_freelist((void **)(contact->recipients),
(genfree_t)eml_freerecipient);
contact->mailfrom=rou_freestr(contact->mailfrom);
-(void) getsessid(contact);
(void) transmit(contact,true,"%d %s opening new session %s",
CMDOK,LOCSEQ,contact->session->sessid);
return true;
code=eml_getcode(line);
switch (code) {
case c_data : //Peer request to transfer email corps.
+
proceed=getdata(contact);
break;
case c_helo : //HELO SMTP protocol