nsmcp::SmtpLogTool method options (protected)

 <instance of nsmcp::SmtpLogTool[i]> options arguments

Defined in /usr/local/ns/tcl/nsmcp/smtp-tools.tcl

Parameters:
arguments (required)

Testcases:
No testcase defined.
Source code:
if {[lindex $arguments 1] ne "object"} {error "Expected arguments object"}
set options {log event module nssmtpd lastMinutes 60 limit 20 includePeerAddresses false}
foreach {key type value} [lindex $arguments 2] {
    switch -- $key {
        log {
            if {$type ne "string" || $value ni {event send}} {error "log must be event or send"}
        }
        module {
            if {$type ne "string" || ![regexp {^[A-Za-z0-9_.-]+$} $value]} {error "Invalid SMTP module name"}
        }
        lastMinutes - limit {
            set maximum [expr {$key eq "limit" ? 100 : 1440}]
            if {$type ne "number" || ![string is integer -strict $value] || $value < 1 || $value > $maximum} {
                error "$key must be an integer between 1 and $maximum"
            }
        }
        session - event - status - contains {
            if {$type ne "string" || [string length $value] > 256 || [regexp {[\x00\r\n]} $value]} {error "Invalid $key filter"}
        }
        includePeerAddresses {
            if {$type ne "boolean"} {error "includePeerAddresses must be boolean"}
        }
        default {error "Unknown argument: $key"}
    }
    dict set options $key $value
}
if {[dict get $options log] eq "send" && ([dict exists $options event] || [dict exists $options session])} {
    error "event and session filters require eventlog"
}
return $options
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: