acs_mail_lite::sched_parameters (public)
acs_mail_lite::sched_parameters [ -sredpcs_override sredpcs_override ] \ [ -reprocess_old_p reprocess_old_p ] \ [ -max_concurrent max_concurrent ] \ [ -max_blob_chars max_blob_chars ] [ -mpri_min mpri_min ] \ [ -mpri_max mpri_max ] [ -hpri_package_ids hpri_package_ids ] \ [ -lpri_package_ids lpri_package_ids ] \ [ -hpri_party_ids hpri_party_ids ] \ [ -lpri_party_ids lpri_party_ids ] \ [ -hpri_subject_glob hpri_subject_glob ] \ [ -lpri_subject_glob lpri_subject_glob ] \ [ -hpri_object_ids hpri_object_ids ] \ [ -lpri_object_ids lpri_object_ids ] \ [ -reject_on_hit reject_on_hit ] \ [ -reject_on_miss reject_on_miss ]
Defined in packages/acs-mail-lite/tcl/email-inbound-procs.tcl
Returns a name value list of parameters used by ACS Mail Lite scheduled procs. If a parameter is passed with value, the value is assigned to parameter.
- Switches:
- Options:
- -sredpcs_override (optional)
- If set, use this instead of si_dur_per_cycle_s. See www/doc/analysis-notes
- -reprocess_old_p (optional)
- If set, does not ignore prior unread email
- -max_concurrent (optional)
- Max concurrent processes to import (fast priority)
- -max_blob_chars (optional)
- Email body parts larger are stored in a file.
- -mpri_min (optional)
- Minimum threshold integer for medium priority. Smaller is fast High priority.
- -mpri_max (optional)
- Maximum integer for medium priority. Larger is Low priority.
- -hpri_package_ids (optional)
- List of package_ids to process at fast priority.
- -lpri_package_ids (optional)
- List of package_ids to process at low priority.
- -hpri_party_ids (optional)
- List of party_ids to process at fast/high priority.
- -lpri_party_ids (optional)
- List of party_ids to process at low priority.
- -hpri_subject_glob (optional)
- When email subject matches, flag as fast priority.
- -lpri_subject_glob (optional)
- When email subject matches, flag as low priority.
- -hpri_object_ids (optional)
- List of object_ids to process at fast/high priority.
- -lpri_object_ids (optional)
- List of object_ids to process at low priority.
- -reject_on_hit (optional)
- Name/Value list. See acs_mail_lite::inbound_filters
- -reject_on_miss (optional)
- Name/Value list. See acs_mail_lite::inbound_filters
- -sched_parameter
- value
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_mail_lite_inbound_procs_check
Source code: # See one row table acs_mail_lite_ui # sched_parameters sp set sp_list [list sredpcs_override reprocess_old_p max_concurrent max_blob_chars mpri_min mpri_max hpri_package_ids lpri_package_ids hpri_party_ids lpri_party_ids hpri_subject_glob lpri_subject_glob hpri_object_ids lpri_object_ids reject_on_hit reject_on_miss ] foreach sp $sp_list { if { [info exists $sp] } { set new(${sp}) [set $sp] } } set changes_p [array exists new] set exists_p [db_0or1row acs_mail_lite_ui_r { select sredpcs_override, reprocess_old_p, max_concurrent, max_blob_chars, mpri_min, mpri_max, hpri_package_ids, lpri_package_ids, hpri_party_ids, lpri_party_ids, hpri_subject_glob, lpri_subject_glob, hpri_object_ids, lpri_object_ids, reject_on_hit, reject_on_miss from acs_mail_lite_ui fetch first 1 rows only } ] if { !$exists_p } { # set initial defaults set sredpcs_override 0 set reprocess_old_p "f" set max_concurrent 6 set max_blob_chars 32767 set mpri_min "999" set mpri_max "99999" set hpri_package_ids "" set lpri_package_ids "" set hpri_party_ids "" set lpri_party_ids "" set hpri_subject_glob "" set lpri_subject_glob "" set hpri_object_ids "" set lpri_object_ids "" set reject_on_hit "" set reject_on_miss "" } if { !$exists_p || $changes_p } { set validated_p 1 set new_pv_list [array names new] if { $changes_p } { foreach spn $new_pv_list { switch -exact -- $spn { sredpcs_override - max_concurrent - max_blob_chars - mpri_min - mpri_max { set v_p [string is integer -strict $new(${spn})] if { $v_p } { if { $new(${spn}) < 0 } { set v_p 0 } } if { $v_p && $spn eq "mpri_min" } { if { $new(${spn}) >= $mpri_max } { set v_p 0 ns_log Warning "acs_mail_lite:: sched_parameters mpri_min '$new(${spn})' must be less than mpri_max '${mpri_max}'" } } if { $v_p && $spn eq "mpri_max" } { if { $new(${spn}) <= $mpri_min } { set v_p 0 ns_log Warning "acs_mail_lite:: sched_parameters mpri_min '${mpri_min}' must be less than mpri_max '$new(${spn})'" } } } reprocess_old_p { set v_p [string is boolean -strict $new(${spn}) ] } hpri_package_ids - lpri_package_ids - hpri_party_ids - lpri_party_ids - hpri_object_ids - lpri_object_ids { # test, if list contains only integers set map [lmap x $new(${spn}) {if {[string is integer -strict $x]} continue; set x} ] set v_p [expr {$map eq ""}] } hpri_subject_glob - lpri_subject_glob { if { $new(${spn}) eq "" } { set v_p 1 } else { set v_p [regexp -- {^[[:graph:]\ ]+$} $new(${spn})] if { $v_p && [string match {*[\[;]*} $new(${spn})] } { set v_p 0 } } } reject_on_hit - reject_on_miss { if { [f::even_p [llength $new(${spn}) ]] } { set v_p 1 } else { set v_p 0 } } defaults { ns_log Warning "acs_mail_lite::sched_parameters No validation check made for parameter '${spn}'" } } if { !$v_p } { set validated_p 0 ns_log Warning "acs_mail_lite::sched_parameters value '$new(${spn})' for parameter '${spn}' not allowed." } } } if { $validated_p } { foreach sp_n $new_pv_list { set ${sp_n} $new($sp_n) } db_transaction { if { $changes_p } { db_dml acs_mail_lite_ui_d { delete from acs_mail_lite_ui } } db_dml acs_mail_lite_ui_i { insert into acs_mail_lite_ui (sredpcs_override, reprocess_old_p, max_concurrent, max_blob_chars, mpri_min, mpri_max, hpri_package_ids, lpri_package_ids, hpri_party_ids, lpri_party_ids, hpri_subject_glob, lpri_subject_glob, hpri_object_ids, lpri_object_ids, reject_on_hit, reject_on_miss) values (:sredpcs_override, :reprocess_old_p, :max_concurrent, :max_blob_chars, :mpri_min, :mpri_max, :hpri_package_ids, :lpri_package_ids, :hpri_party_ids, :lpri_party_ids, :hpri_subject_glob, :lpri_subject_glob, :hpri_object_ids, :lpri_object_ids, :reject_on_hit, :reject_on_miss ) } # See acs_mail_lite::imap_check_incoming for usage of: nsv_set acs_mail_lite si_configured_p 1 } } } set s_list [list ] foreach s $sp_list { set sv [set ${s}] lappend s_list ${s} $sv } return $s_listXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-mail-lite/tcl/email-inbound-procs.xql