# Copyright (c) 2010 Flowerfire, Inc. All Rights Reserved. i_mail = { plugin_version = "1.0.1" # Initial creation - 1.0 # 2010-12-14 - 1.0.1 - MSG - Edited info lines. info.1.manfacturer = "Ipswitch" info.1.device = "IMail Server" info.1.version.1 = "" # The name of the log format log.format.format_label = "iMail 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 = "^[0-9][0-9]:[0-9][0-9] [0-9][0-9]:[0-9][0-9] [A-Z0-9]*-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\) " # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" # The format of dates and times in this log log.format.date_format = "mm/dd" log.format.time_format = "hhmm" # An entry in this log is called a "message" in the statistics (not a "hit") statistics.miscellaneous.entry_name = "messages" # Log fields log.fields = { date = { label = "$lang_stats.field_labels.date" type = "date" index = 0 subindex = 0 hierarchy_dividers = "" left_to_right = false leading_divider = "false" } # date time = { label = "$lang_stats.field_labels.time" type = "time" index = 0 subindex = 0 hierarchy_dividers = "" left_to_right = false leading_divider = "false" } # time operation = { label = "$lang_stats.field_labels.operation" type = "flat" index = 0 subindex = 0 } # operation protocol = { label = "$lang_stats.field_labels.protocol" type = "flat" index = 0 subindex = 0 } # protocol from = { label = "$lang_stats.field_labels.from" type = "hierarchical" index = 0 subindex = 0 hierarchy_dividers = "@" left_to_right = false leading_divider = "false" } # from to = { label = "$lang_stats.field_labels.to" type = "hierarchical" index = 0 subindex = 0 hierarchy_dividers = "@" left_to_right = false leading_divider = "false" } # to server_domain = { label = "$lang_stats.field_labels.server_domain" type = "flat" index = 0 subindex = 0 } # server_domain source_ip = { label = "$lang_stats.field_labels.source_ip" type = "host" index = 0 subindex = 0 hierarchy_dividers = "." left_to_right = false leading_divider = "false" } # source_ip size = { label = "$lang_stats.field_labels.size" type = "size" index = 0 subindex = 0 hierarchy_dividers = "" left_to_right = false leading_divider = "false" } # size } # log.fields # # Log Parsing Filters log.parsing_filters = { # If this is an SMTP processing entry, rekey the log entry to use the SMTP key as its key 1 = { label = "1" comment = "" value = "if (matches_regular_expression(current_log_line(), ' SMTP-*\\\\(([A-Z0-9]*)\\\\) processing [A-Za-z]:.*spool.Q(.*)$')) then rekey_collected_entry($2, $1);" } # 1 # Parse out the datestamp 2 = { label = "2" comment = "" value = "collect_fields_using_regexp('^([0-9][0-9]:[0-9][0-9]) ([0-9][0-9]:[0-9][0-9]) (SMTP|SMTPD)-*\\\\(([0-9A-Z]*)\\\\) ', 'date,time,protocol,*KEY*')" } # 2 # Parse ldeliver, rdeliver and gdeliver lines # Note: we could get "to" and "from" here too, but for ldeliver at least, we get better results # by using what we got earlier from the SMTP messages (e.g. RCPT TO). # collect_multiple_fields_regexp " SMTP-\(([A-Z0-9]*)\) ([lrg]deliver) [^ ]* ([^ ]*) \([0-9]\) ([^ ]*) ([0-9]*)" "*KEY*,operation,to,from,size" "" "" 3 = { label = "3" comment = "" value = "collect_fields_using_regexp(' SMTP-\\\\(([A-Z0-9]*)\\\\) ([lrg]deliver) [^ ]* [^ ]* \\\\([0-9]\\\\) [^ ]* ([0-9]*)', '*KEY*,operation,size')" } # 3 # Accept this log entry, if it's an deliver entry 4 = { label = "4" comment = "" value = "accept_collected_entry_using_regexp('\\\\(([A-Z0-9]*)\\\\) [lrg]deliver ', false)" } # 4 # Parse forwarded lines 5 = { label = "5" comment = "" value = "collect_fields_using_regexp(' SMTP-\\\\(([A-Z0-9]*)\\\\) (forward)ed message to ([^ ]*)', '*KEY*,operation,to')" } # 5 # Accept this log entry, if it's a forwarded entry 6 = { label = "6" comment = "" value = "accept_collected_entry_using_regexp('\\\\(([A-Z0-9]*)\\\\) forwarded ', false)" } # 6 # Parse HELO lines 7 = { label = "7" comment = "" value = "collect_fields_using_regexp(' SMTPD\\\\(([0-9A-F]*)\\\\) \\\\[([0-9.]*)\\\\] HELO (.*)', '*KEY*,source_ip,server_domain')" } # 7 # Parse MAIL FROM lines 8 = { label = "8" comment = "" value = "collect_fields_using_regexp(' SMTPD\\\\(([0-9A-F]*)\\\\) \\\\[([0-9.]*)\\\\] [Mm][Aa][Ii][Ll] [Ff][Rr][Oo][Mm]: *(.*)$', '*KEY*,source_ip,from')" } # 8 # Parse RCPT TO lines 9 = { label = "9" comment = "" value = "collect_fields_using_regexp(' SMTPD\\\\(([0-9A-F]*)\\\\) \\\\[([0-9.]*)\\\\] [Rr][Cc][Pp][Tt] [Tt][Oo]: *(.*)$', '*KEY*,source_ip,to')" } # 9 # Parse spool lines 10 = { label = "10" comment = "" value = "collect_fields_using_regexp(' SMTPD\\\\(([0-9A-F]*)\\\\) \\\\[([0-9.]*)\\\\] [A-Za-z]:.*spool[^ ]* ([0-9]*)$', '*KEY*,source_ip,size')" } # 10 # If this is an SMTPD spool entry, rekey the log entry to use the spool filename as its key 11 = { label = "11" comment = "" value = "if (matches_regular_expression(current_log_line(), ' SMTPD\\\\(([A-Z0-9]*)\\\\) \\\\[[0-9.]*\\\\] [A-Za-z]:.*spool.D([^ ]*) [0-9]*')) then rekey_collected_entry($1, $2);" } # 11 # # Accept this collected log entry, if it's a SMTPD entry # do_b # "" "" "" "" "" # accept_collected_entry_regexp " SMTPD\(([0-9A-F]*)\) \[[0-9.]*\] [A-Za-z]:.*spool[^ ]* [0-9]*$" "" "" "" # goto_next_filter "" "" "" "" # "" } # log.parsing_filters # 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 server_domain = { label = "$lang_stats.field_labels.server_domain" log_field = "server_domain" type = "string" suppress_top = 0 suppress_bottom = 2 } # server_domain source_ip = { label = "$lang_stats.field_labels.source_ip" log_field = "source_ip" type = "string" suppress_top = 0 suppress_bottom = 2 } # source_ip operation = { label = "$lang_stats.field_labels.operation" log_field = "operation" type = "string" suppress_top = 0 suppress_bottom = 2 } # operation from = { label = "$lang_stats.field_labels.from" log_field = "from" type = "string" suppress_top = 0 suppress_bottom = 3 } # from to = { label = "$lang_stats.field_labels.to" log_field = "to" type = "string" suppress_top = 0 suppress_bottom = 3 } # to } # database.fields # # Log Filters log.filters = { # Delete < from the "from" 1 = { label = "1" comment = "" value = "from = replace_first(from, '<', '');" } # 1 # Delete < from the "to" fiel 2 = { label = "2" comment = "" value = "to = replace_first(to, '<', '');" } # 2 # Delete > from the "from" field 3 = { label = "3" comment = "" value = "from = replace_first(from, '>', '');" } # 3 # Delete > from the "to" field 4 = { label = "4" comment = "" value = "to = replace_first(to, '>', '');" } # 4 mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'messages = 1;' } # mark_entry } # log.filters database.numerical_fields = { messages = { label = "$lang_stats.field_labels.messages" default = true requires_log_field = false type = "int" display_format_type = "integer" entries_field = true } # messages size = { label = "$lang_stats.field_labels.size" default = false requires_log_field = true log_field = "size" type = "float" display_format_type = "bandwidth" } # size } # database.numerical_fields create_profile_wizard_options = { date_time_tracking = true host_tracking = true # How the reports should be grouped in the report menu report_groups = { date_time_group = "" server_domain = true source_ip = true operation = true from = true to = true } # report_groups } # create_profile_wizard_options not_supported = { visitors = true sessions = true pageviews = true } # not_supported } # i_mail