diff options
Diffstat (limited to 'dovecot-model.lua')
-rw-r--r-- | dovecot-model.lua | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/dovecot-model.lua b/dovecot-model.lua index 25393e0..74aff69 100644 --- a/dovecot-model.lua +++ b/dovecot-model.lua @@ -10,7 +10,7 @@ local configfile = "/etc/dovecot/dovecot.conf" local processname = "dovecot" local packagename = "dovecot" -local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " +local config -- ################################################################################ -- LOCAL FUNCTIONS @@ -42,4 +42,22 @@ function mymodule.update_filedetails(self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}) end +function mymodule.get_logfile(f) + config = config or format.parse_ini_file(fs.read_file(configfile) or "", "") + local files = {} + if config and config.log_path then + files[#files+1] = {path = config.log_path} + end + if config and config.info_log_path then + files[#files+1] = {path = config.info_log_path} + end + if config and config.log_path then + files[#files+1] = {path = config.debug_log_path} + end + if 0 == #files then + files[#files+1] = {path = "/var/log/messages", grep = "dovecot"} + end + return cfe({ value=files, label="DoveCot Log Files" }) +end + return mymodule |