emlrec.o: emlrec.c \
../lib/modrec.h \
+ ../lib/unisig.h \
../lib/uniprc.h \
../lib/unipar.h \
../lib/subrou.h \
maild.o : maild.c \
- ../lib/modrec.h \
../lib/uniprc.h \
+ ../lib/unisig.h \
../lib/unipar.h \
../lib/subrou.h \
\f
*/
/********************************************************/
-/* */
-/* Waiting and handling smtp request */
-/* */
-/********************************************************/
-static void rec_handlesmtp()
-
-{
-int phase;
-_Bool proceed;
-
-phase=0;
-proceed=true;
-while (proceed==true) {
- switch (phase) {
- case 0 : //looping forever email receiving processes
- (void) prc_settitle("emlrec with pid='%06d'",getpid());
- break;
- case 1 : //Terminating all remaining process
- (void) sleep(1);
- if (hangup==false)
- phase--; //looping forever
- break;
- default : //SAFE Guard
- proceed=false;
- break;
- }
- phase++;
- }
-}
-/*
-\f
-*/
-/********************************************************/
/* */
/* Main routine */
/* Start multiple SMTP daemon and make */
#include "unipar.h"
#include "uniprc.h"
#include "unisig.h"
-#include "modrec.h"
-//port listening format is "IP:PORT NUMBER:num iteration"
-#define PORTREC "192.168.0.1:25:2"
/*
\f
*/
(void) par_modeunipar(true);
(void) prc_modeuniprc(true);
(void) sig_modeunisig(true);
- (void) rec_modemodrec(true);
(void) sig_trapsignal(true,sig_alrm);
break;
case 3 : //doing main tash
(void) prc_cleantitle();
params=par_freeparams(params);
(void) sig_trapsignal(false,sig_alrm);
- (void) rec_modemodrec(false);
(void) sig_modeunisig(false);
(void) prc_modeuniprc(false);
(void) par_modeunipar(false);
#include "modrec.h"
static _Bool modopen; //boolean module open/close
-
/*
\f
*/
/********************************************************/
/* */
+/* Waiting and handling smtp request */
/* */
/********************************************************/
-//procedure to receive email form outside
-void rec_getemail(int attend)
+PUBLIC void rec_handlesmtp()
{
-(void) rou_alert(0,"JMPDBG getemail with pid='%06d' (wait for '%0d')",
- getpid(),attend);
-(void) prc_settitle("JMPDBG getemail with pid='%06d' (wait for '%0d')",
- getpid(),attend);
-while (attend>0) {
- (void) sleep(1);
- if (hangup==true) {
- (void) rou_alert(0,"JMPDBG got hangup signal");
- break;
+int phase;
+_Bool proceed;
+
+phase=0;
+proceed=true;
+while (proceed==true) {
+ switch (phase) {
+ case 0 : //looping forever email receiving processes
+ (void) prc_settitle("emlrec with pid='%06d'",getpid());
+ break;
+ case 1 : //Terminating all remaining process
+ (void) sleep(1);
+ if (hangup==false)
+ phase--; //looping forever
+ break;
+ default : //SAFE Guard
+ proceed=false;
+ break;
}
- attend--;
+ phase++;
}
-(void) rou_alert(0,"JMPDBG exiting from pid='%06d'",getpid());
}
/*
^L
#include <stdbool.h>
//procedure to receive email form outside
-extern void rec_getemail(int attend);
+extern void rec_handlesmtp();
//homework to be done before starting/stoping module.
extern int rec_modemodrec(_Bool mode);
//version definition
#define VERSION "0.2"
-#define RELEASE "2"
+#define RELEASE "3"
//Public variables
PUBLIC int debug=0; //debug level