/* Procedure to display SPF debug information */
/* */
/********************************************************/
-static void dbgspf(int dbg,AFNTYP *afnnum,char *seq,SPFENU status)
+static void dbgspf(int dbg,char *proc,char *domain,AFNTYP *afnnum,char *seq,SPFENU status)
{
if (debug>-dbg) {
- (void) rou_alert(dbg,"Current SPF Value <%s>\n\tIP=[%s]\n\tSPF=<%s>",
- dns_spfASCII(status),afnnum->strnumip,seq);
+ (void) rou_alert(dbg,"Origin=\"%s\"\n"
+ "\tCurrent SPF Value <%s>\n"
+ "\tPeer IP=[%s]\n"
+ "\tdomain=<%s> SPF=<%s>",
+ proc,dns_spfASCII(status),afnnum->strnumip,domain,seq);
}
}
/*
*/
/********************************************************/
/* */
+/* Procedure to check the SPF MX values againt the */
+/* current afnnum. */
+/* return true if successful. */
+/* */
+/********************************************************/
+static _Bool checkmx(char *domain,AFNTYP *afnnum,char *seq)
+
+{
+_Bool found;
+
+found=false;
+return found;
+}
+/*
+\f
+*/
+/********************************************************/
+/* */
/* Procedure to check ip peerip is within an */
/* spf sequence */
/* */
case mch_all : //usually last in sequence
spf=locspf;
break;
+ case mch_mx : //This is a MX refrence
+ if (checkmx(domain,afnnum,seq+1)==true)
+ spf=locspf;
+ break;
case mch_ip4 : //This is IPV4 number
case mch_ip6 : //This is IPV6 number
if (checkip(domain,afnnum,seq+1)==true)
spf=locspf;
+ (void) dbgspf(2,"checkip",domain,afnnum,seq+1,spf);
break;
case mch_include : //include sub domain
if (seq[0]==':') {
break;
case 2 : //making sure spfrec is an SPF1
spfrec+=strlen(SPF1);
- (void) dbgspf(2,afnnum,spfrec,spf);
if (strlen(spfrec)>0) {
char *seq;
+ char *ref;
+ ref=spfrec;
while ((seq=getspfseq(spfrec))!=(char *)0) {
spfrec=strstr(spfrec,seq);
spfrec+=strlen(seq);
spf=checkseq(try,domain,seq,afnnum,spf);
seq=rou_freestr(seq);
if (spf!=spf_neutral)
- break; //Found a status breaking loop
+ break; //Found a pass status, breaking loop
}
+ (void) dbgspf(2,"is_peerip_ok",domain,afnnum,ref,spf);
}
break;
default : //SAFE Guard