summaryrefslogtreecommitdiffstats
path: root/postfix-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'postfix-model.lua')
-rw-r--r--postfix-model.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/postfix-model.lua b/postfix-model.lua
index f05fa40..32eb2ce 100644
--- a/postfix-model.lua
+++ b/postfix-model.lua
@@ -50,8 +50,14 @@ end
local function geteditablefilelist()
local listed_files = fs.find_files_as_array("[^%.].*", baseurl)
- table.insert(listed_files, aliasesfile)
- return listed_files
+ -- remove .db files
+ local result = {}
+ for i,name in ipairs(listed_files) do
+ if not string.find(name, "%.db$") then
+ result[#result+1] = name
+ end
+ end
+ return result
end
function getfilelist()
@@ -90,6 +96,8 @@ function createfile(newfile)
if validator.is_valid_filename(path, baseurl) then
if posix.stat(path) then
newfile.value.filename.errtxt = "File already exists"
+ elseif string.find(path, "%.db$") then
+ newfile.value.filename.errtxt = "Cannot create .db files"
else
fs.create_file(path)
newfile.errtxt = nil