# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved. qmail_scanner = { plugin_version = "1.2" info.1.manufacturer = "Qmail" info.1.device = "Scanner" info.1.version.1 = "1.06" # 2006-11-24 - GMF - 1.1 - Added support for dd/mm/yyyy hh:mm:ss header; cleaned up a bit. # 2010-10-05 - 1.2 - MSG - Edited info lines. # The name of the log format log.format.format_label = "qmail-scanner Log Format" log.miscellaneous.log_data_type = "mail_server" log.miscellaneous.log_format_type = "mail_server" # The log is in this format if any of the first ten lines match this regular expression log.format.autodetect_regular_expression = "^([A-Z][a-z][a-z], [0-9][0-9] [A-Z][a-z][a-z] [0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [A-Z]+|[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]) [^ ]+@[^ ]+ [^ ]+@[^ ]+ [^ ]+ [^ ]+ [^ ]+$" # The regular expression to extract the fields from each line # log.format.parsing_regular_expression = "^[A-Za-z]+, ([0-9]+ [A-Za-z]+ [0-9]+) ([0-9:]+) [A-Z]+ ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)$" # The format of dates and times in this log log.format.date_format = "auto" log.format.time_format = "auto" # Log fields log.fields = { date = { label = "$lang_stats.field_labels.date" type = "date" } # date time = { label = "$lang_stats.field_labels.time" type = "time" } # time from = { label = "$lang_stats.field_labels.from" type = "hierarchical" hierarchy_dividers = "@" left_to_right = false leading_divider = false } # from to = { label = "$lang_stats.field_labels.to" type = "hierarchical" hierarchy_dividers = "@" left_to_right = false leading_divider = false } # to subject = { label = "$lang_stats.field_labels.subject" type = "flat" } # subject virus = { label = "$lang_stats.field_labels.virus" type = "flat" } # virus version = { label = "$lang_stats.field_labels.version" type = "flat" } # version } # log.fields log.parsing_filters.parse = ` if (matches_regular_expression(current_log_line(), "^[A-Za-z]+, ([0-9]+ [A-Za-z]+ [0-9]+) ([0-9:]+) [A-Z]+ ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)$")) then ( date = $1; time = $2; from = $3; to = $4; subject = $5; virus = $6; version = $7; ); # e.g. # 20/09/2006 12:10:04 someone@there.fm other@here.cn hello Heuristic/DoubleExtension.Crypted heuristic hbedv: 6.21.0.0/6.21.0.2. else if (matches_regular_expression(current_log_line(), "^([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9]) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)$")) then ( date = $2 . "/" . $1 . "/" . $3; time = $4; from = $5; to = $6; subject = $7; virus = $8; version = $9; ); ` # Database fields database.fields = { date_time = { label = "$lang_stats.field_labels.date_time" log_field = "date_time" type = "string" suppress_top = 0 suppress_bottom = 3 display_format_type = "date_time" } # date_time day_of_week = { label = "$lang_stats.field_labels.day_of_week" log_field = "day_of_week" type = "string" suppress_top = 0 suppress_bottom = 2 display_format_type = "day_of_week" } # day_of_week hour_of_day = { label = "$lang_stats.field_labels.hour_of_day" log_field = "hour_of_day" type = "string" suppress_top = 0 suppress_bottom = 2 display_format_type = "hour_of_day" } # hour_of_day from = { label = "$lang_stats.field_labels.from" log_field = "from" type = "string" } # from to = { label = "$lang_stats.field_labels.to" log_field = "to" type = "string" } # to subject = { label = "$lang_stats.field_labels.subject" log_field = "subject" type = "string" } # subject virus = { label = "$lang_stats.field_labels.virus" log_field = "virus" type = "string" } # virus version = { label = "$lang_stats.field_labels.version" log_field = "version" type = "string" } # version } # database.fields database.numerical_fields = { viruses = { label = "$lang_stats.field_labels.viruses" default = true requires_log_field = false type = "int" display_format_type = "integer" entries_field = true } # viruses } # database.numerical_fields log.filters = { mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'viruses = 1;' } # mark_entry } # log.filters create_profile_wizard_options = { # How the reports should be grouped in the report menu report_groups = { date_time_group = "" from = true to = true subject = true virus = true version = true } # report_groups } # create_profile_wizard_options } # qmail_scanner