summaryrefslogtreecommitdiffstats
path: root/fetchmail-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'fetchmail-model.lua')
-rw-r--r--fetchmail-model.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/fetchmail-model.lua b/fetchmail-model.lua
index fa7dbf2..d3dd51c 100644
--- a/fetchmail-model.lua
+++ b/fetchmail-model.lua
@@ -325,7 +325,7 @@ function update_filecontent(filedetails)
end
function getconfig()
- local interval = cfe({ value=60, label="Polling Interval", descr="Interval in seconds" })
+ local interval = cfe({ value="60", label="Polling Interval", descr="Interval in seconds" })
local postmaster = cfe({ label="Postmaster", descr="If defined, undeliverable mail is sent to this account, otherwise it is discarded" })
local bounceerrors = cfe({ type="boolean", value=true, label="Bounce Errors", descr="Bounce errors back to the sender or send them to the postmaster" })
@@ -338,9 +338,9 @@ function getconfig()
end
end
- local confd = format.parse_configfile2(fs.read_file(confdfile), "", "polling_period")
+ local confd = format.parse_ini_file(fs.read_file(confdfile), "", "polling_period")
if confd then
- interval.value = confd
+ interval.value = string.sub(confd, 2, -2)
end
return cfe({ type="group", value={interval=interval, postmaster=postmaster, bounceerrors=bounceerrors}, label="Fetchmail Global Config" })
@@ -376,7 +376,7 @@ function updateconfig(conf)
posix.chmod(configfile, "rwx--x---")
config = nil
- fs.write_file(confdfile, format.update_configfile2(fs.read_file(confdfile) or "", "", "polling_period", '"'..conf.value.interval.value..'"'))
+ fs.write_file(confdfile, format.update_ini_file(fs.read_file(confdfile) or "", "", "polling_period", '"'..conf.value.interval.value..'"'))
else
conf.errtxt = "Failed to set configuration"
end