Hi to all. I need help regarding my script that work perfect on 2.9 release but on 3.x release not work.
The problem is in :resolve command. In 2.9 release work but in 3.0 release responde "failure".
The Primary DNS and Secondary DNS is correct and work but for example if i write:
:resolve www2.media.it . On 2.9 reply widthout any error. On 3.x reply "failure".
www2.media.it not is definied in DNS entry but because "failure" ? Failure condition stop my script but also for 0.0.0.0 address, 3.x release, reply "failure".
This is a problem when i ask to resolve ip for spam-check blacklist as in following script.
The reply on resolve command in 2.9 release is 0.0.0.0 (for spammer ip) and failure for 3.x release and script NOT WORK !!
my conclusion is. On 3.x release any command :resolve with incorrect address or reply 0.0.0.0 address cause failure script and all stop my script.
:global SCRIPT "";
:global ALIST "";
:global COMM "";
:global IP "";
:global IPL "";
:global A "";
:global B "";
:global C "";
:global D "";
:global n 0;
:global l 0;
:global COUNT 0;
:global DSBL "";
:global SPAM "";
:global NOME "";
:set SCRIPT "itwbspam";
:if ([:len [/system script job find script=$SCRIPT]] < 10) do={
:set ALIST checkspam;
:foreach IPT in [/ip firewall address-list find list=$ALIST] do={
:set COMM [/ip firewall address-list get $IPT comment];
:if ($COMM = "") do={
/ip firewall address-list set $IPT comment=checking;
:set IP [/ip firewall address-list get $IPT address];
:set IPL $IP;
:set l [:len $IP];
:set n [:find $IP .];
:set A [:pick $IP 0 $n];
:set IP [:pick $IP ($n + 1) 15];
:set n [:find $IP .];
:set B [:pick $IP 0 $n];
:set l [:len $IP];
:set IP [:pick $IP ($n + 1) 15];
:set n [:find $IP .];
:set C [:pick $IP 0 $n];
:set l [:len $IP];
:set IP [:pick $IP ($n + 1) 15];
:set D $IP;
:set COUNT 0;
:set DSBL .dnsbl.sorbs.net;
:set NOME ($D . "." . $C . "." . $B . "." . $A . $DSBL);
:log info $NOME
:set IP [:resolve $NOME];
:if ($IP != "0.0.0.0") do={ :set COUNT ($COUNT + 1); }
:set DSBL .cbl.abuseat.org;
:set SPAM 127.0.0.2;
:set NOME ($D . "." . $C . "." . $B . "." . $A . $DSBL);
:set IP [:resolve $NOME];
:if ($IP = $SPAM) do={ :set COUNT ($COUNT + 1); }
:set DSBL .bl.spamcop.net;
:set SPAM 127.0.0.2;
:set NOME ($D . "." . $C . "." . $B . "." . $A . $DSBL);
:set IP [:resolve $NOME];
:if ($IP = $SPAM) do={ :set COUNT ($COUNT + 1); }
:set DSBL .combined.njabl.org;
:set SPAM 127.0.0.2;
:set NOME ($D . "." . $C . "." . $B . "." . $A . $DSBL);
:set IP [:resolve $NOME];
:if ($IP = $SPAM) do={ :set COUNT ($COUNT + 1); }
:set DSBL .bhnc.njabl.org;
:set SPAM 127.0.0.2;
:set NOME ($D . "." . $C . "." . $B . "." . $A . $DSBL);
:set IP [:resolve $NOME];
:if ($IP = $SPAM) do={ :set COUNT ($COUNT + 1); }
:if ($COUNT > 1) do= {
:if ($COUNT = 1) do={ /ip firewall address-list add list=tempspamlight address=$IPL; }
:if ($COUNT = 2) do={ /ip firewall address-list add list=tempspammedium address=$IPL; }
:if ($COUNT = 3) do={ /ip firewall address-list add list=tempspamhard address=$IPL; }
:if ($COUNT > 3) do={ /ip firewall address-list add list=tempspamhard address=$IPL; }
} else= {
/ip firewall address-list add list=tempsmtp address=$IPL;
}
/ip firewall address-list remove $IPT;
}
}
}
I can solve ?
help please