switch ((*ptr)->code) {
case 'L' : //local delivery
(*ptr)->code='C'; //delivery done 'C'ompleted
+ (void) eml_add_delay(*ptr);
if (eml_store_email(*ptr)==false) {
- (*ptr)->code='D'; //delivery done 'D'elayed
+ (*ptr)->code='L'; //delivery done 'D'elayed
(void) rou_alert(0,"%s Unable to deliver email <%s> to <%s>",
OPEP,(*ptr)->sessid,(*ptr)->rcptto);
}
break;
case 'R' : //remote delivery
- (*ptr)->code='C'; //delivery completed Temporary JMPDBG
+ //JMPDBG set as the remote email was not succesful
+ (void) eml_add_delay(*ptr);
break;
default :
(void) rou_alert(0,"%s unexpected code '%c'",OPEP,(*ptr)->code);
}
ptr++;
}
- (void) eml_dumptra((FILE *)0,tra);
}
return status;
#undef OPEP
while (*tra!=(TRATYP *)0) {
char line[300];
- (void) snprintf(line,sizeof(line),"%c %lu %u %s %s %s",
+ (void) snprintf(line,sizeof(line),"%c %lu %04u %s %s %s",
(*tra)->code,
(*tra)->date,
(*tra)->delay,
#undef OPEP
}
+/*
+\f
+*/
+/********************************************************/
+/* */
+/* Procedure to add an execution delay to an email */
+/* sending request. */
+/* Return true if succesfull, false otherwise */
+/* */
+/********************************************************/
+PUBLIC _Bool eml_add_delay(TRATYP *tra)
+
+{
+_Bool status;
+
+status=false;
+if (tra!=(TRATYP *)0) {
+ tra->delay=(tra->delay*2)+60;
+ status=true;
+ }
+return status;
+}
//procedure to store an email to the local email storage area
extern _Bool eml_store_email(TRATYP *tra);
+//procedure to add execution delay to an email sending
+extern _Bool eml_add_delay(TRATYP *tra);
+
#endif