Max size of variables still at 4096!? Anwser is NO

Using my method is imported the fulll list without problem.
:global readfile do={
:local url $1
:local thefile “”
:local filesize ([/tool fetch url=$url as-value output=none]->“downloaded”)
:local maxsize 64512 ; # is the maximum supported readable size of a block from a file
:local start 0
:local end ($maxsize - 1)
:local partnumber ($filesize / ($maxsize / 1024))
:local reminder ($filesize % ($maxsize / 1024))
:if ($reminder > 0) do={ :set partnumber ($partnumber + 1) }
:for x from=1 to=$partnumber step=1 do={
:set thefile ($thefile . ([/tool fetch url=$url http-header-field=“Range: bytes=$start-$end” as-value output=user]->“data”))
:set start ($start + $maxsize)
:set end ($end + $maxsize)
}
:return $thefile
}

{
/ip firewall address-list
:local update do={
:global readfile
:put “Starting import of address-list: $listname”
:put “Deleting all Dynamic enties in address-list: $listname”
:if (heirule != null) do={:put “Using as extra filtering: $heirule”}
:if ($heirule = null) do={:set $heirule “.”}
:local n 0; # counter

remove the current list completely

:do { /ip firewall address-list remove [find where list=$listname dynamic]} on-error={};

line replaced ### :local data ([:tool fetch url=$url output=user as-value]->“data”)

:local data [$readfile $url]
:put “Imported file length $[:len $data] bytes”
:while ([:len $data]!=0) do={
:local line [:pick $data 0 [:find $data “\n”]]; # create only once and checked twice as local variable
:if ($line~“[1]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}” && $line~heirule) do={
:set $n ($n+1)
:do {add list=$listname address=[:pick $data 0 [:find $data $delimiter]] comment=$description timeout=$timeout} on-error={};
}; # if IP address && extra filter if present
:set data [:pick $data ([:find $data “\n”]+1) [:len $data]]; # removes the just added IP from the data array
}; # while
:put “Completed importing $listname added/replacing $n lines.”
}; # do

$update url=(“https://” . “view.sentinel.turris.cz/greylist-data/greylist-latest.csv”) delimiter=, listname=turris timeout=8d heirule=http|smtp
}
(URL splitted just to not let the forum alter the url)

Console output:
Starting import of address-list: turris
Deleting all Dynamic enties in address-list: turris
Using as extra filtering: http|smtp
Imported file length 302116 bytes
Completed importing turris added/replacing 4728 lines.


  1. 0-9 ↩︎