uniprc.h: \
subrou.h
-unitls.h: \
+unieml.h \
+unitls.h \
+ : \
subafn.h
libpos.a: unimar.o \
(void) freesessid(contact);
contact->sqlptr=sql_closesql(contact->sqlptr);
contact->logptr=log_closelog(contact->logptr);
- contact->relayok=(char **)rou_freelist((void **)contact->relayok,
- (genfree_t)rou_freestr);
+ contact->relayok=(AFNTYP **)rou_freelist((void **)contact->relayok,
+ (genfree_t)afn_freeipnum);
contact->recipients=(RCPTYP **)rou_freelist((void **)contact->recipients,
(genfree_t)eml_freerecipient);
contact->authname=rou_freestr(contact->authname);
}
break;
case 2 : //loading the relayable IP list
+ //contact->relayok=eml_load_relayed(getenv(RELAYS));
contact->relayok=eml_load_relayed(getenv(RELAYS));
break;
case 3 : //waiting from contact
char *locserv; //local service port
char *peername; //socket remote peer FQDN
char *peerip; //socket remote peer IP
- char **relayok; //List of IP which are relayable
+ AFNTYP **relayok; //List of IP which are relayable
int numreset; //number of SMTP reset received
char *mainsesid; //session main ID
SESTYP *session; //SMTP current session information
#include <unistd.h>
#include <uuid/uuid.h>
+#include "subafn.h"
#include "subrou.h"
#include "unieml.h"
/* relayed. */
/* */
/********************************************************/
-PUBLIC char **eml_load_relayed(char *relayedfile)
+PUBLIC AFNTYP **eml_load_relayed(char *relayedfile)
{
#define OPEP "unieml.c:eml_load_relayed,"
-char **list;
+AFNTYP **list;
char *filename;
FILE *relays;
int phase;
_Bool proceed;
-list=(char **)0;
+list=(AFNTYP **)0;
filename=(char *)0;
relays=(FILE *)0;
phase=0;
num=0;
while (fgets(line,sizeof(line)-1,relays)!=(char *)0) {
- char *mask;
- struct sockaddr_in sa;
+ AFNTYP *afn;
num++;
(void) rou_clean_conf_line(line);
if (strlen(line)==0)
continue;
- if ((mask=strrchr(line,'/'))!=(char *)0)
- *mask='\000';
- if (inet_pton(AF_INET,line,&(sa.sin_addr))<=0) {
+ if ((afn=afn_getoneipnum(line))==(AFNTYP *)0) {
(void) rou_alert(0,"%s line='%03d' <%s> not a valid IP "
"(error=<%s>, config?)",
OPEP,num,line,strerror(errno));
continue;
}
- if (mask!=(char *)0)
- *mask='/';
- list=(char **)rou_addlist((void **)list,strdup(line));
+ list=(AFNTYP **)rou_addlist((void **)list,(void *)afn);
}
}
break;
#include <stdio.h>
+#include "subafn.h"
+
#define HFROM "From: " //Then email header header from
#define HTITLE "Subject: " //Then email subject entry
//Procedure to load the list of IP/Network from
//which incoming email can be relayed to another domain MX
-extern char **eml_load_relayed(char *relayedfile);
+extern AFNTYP **eml_load_relayed(char *relayedfile);
//Procedure to list all file within queue directory
//and with a specific extenstion