.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Mail::MtPolicyd::Plugin::Condition 3pm" .TH Mail::MtPolicyd::Plugin::Condition 3pm "2017-01-13" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mail::MtPolicyd::Plugin::Condition \- mtpolicyd plugin for conditions based on session values .SH "VERSION" .IX Header "VERSION" version 2.02 .SH "DESCRIPTION" .IX Header "DESCRIPTION" Will return an action, score or execute futher plugins if the specified condition matched. .SH "PARAMETERS" .IX Header "PARAMETERS" .IP "key (required)" 4 .IX Item "key (required)" The name of the variable to check. .Sp Syntax is .Sp .Vb 1 \& (:)? .Ve .Sp If no scope is give it defaults to request. .Sp Possible scopes are: .RS 4 .IP "session, s" 4 .IX Item "session, s" Session variables. .IP "request, r" 4 .IX Item "request, r" Request attribute variables. .RE .RS 4 .Sp Examples: .Sp .Vb 2 \& session:user_policy \& s:user_policy \& \& request:queue_id \& r:queue_id \& queue_id .Ve .RE .PP At least one of the following parameters should be given or your condition will never match: .IP "match (default: empty)" 4 .IX Item "match (default: empty)" Simple string equal match. .IP "re_match (default: empty)" 4 .IX Item "re_match (default: empty)" Match content of the session variable against an regex. .IP "lt_match (default: empty)" 4 .IX Item "lt_match (default: empty)" Match if numerical less than. .IP "gt_match (default: empty)" 4 .IX Item "gt_match (default: empty)" Match if numerical greater than. .IP "invert (default: 0)" 4 .IX Item "invert (default: 0)" If set to 1 the logic will be inverted. .PP Finally an action must be specified. .PP First the score will be applied the the action will be executed or if specified additional plugins will be executed. .IP "action (default: empty)" 4 .IX Item "action (default: empty)" The action to return when the condition matched. .IP "score (default: empty)" 4 .IX Item "score (default: empty)" The score to add if the condition matched. .IP "Plugin (default: empty)" 4 .IX Item "Plugin (default: empty)" Execute this plugins when the condition matched. .SH "EXAMPLE: use of postfix policy_context" .IX Header "EXAMPLE: use of postfix policy_context" The policy_context of postfix could be used to trigger checks in mtpolicyd. .PP To activate additional checks in mtpolicyd from within postfix use may use a configuration in postfix main.cf like: .PP .Vb 5 \& # check, no additional checks \& check_policy_service inet:localhost:12345 \& ... \& # check with additional checks! \& check_policy_service { inet:localhost:12345, policy_context=strict_checks } .Ve .PP In mtpolicyd.conf: .PP .Vb 4 \& \& module = "Condition" \& key = "policy_context" \& match = "strict_checks" \& \& \& # ... \& \& # more checks ... \& .Ve .PP The policy_context feature will be available in postfix 3.1 and later. .PP If you need completely different checks consider using the vhost_by_policy_context (mtpolicyd) option with different virtual hosts. .SH "EXAMPLE: execute postgrey action in postfix" .IX Header "EXAMPLE: execute postgrey action in postfix" If the session variable \*(L"greylisting\*(R" is \*(L"on\*(R" return the postfix action \*(L"postgrey\*(R": .PP .Vb 6 \& \& module = "Condition" \& key = "greylisting" \& match = "on" \& action = "postgrey" \& .Ve .PP The variable may be set by a UserConfig module like SqlUserConfig. .PP The postgrey action in postfix may look like: .PP .Vb 2 \& smtpd_restriction_classes = postgrey \& postgrey = check_policy_service inet:127.0.0.1:11023 .Ve .SH "AUTHOR" .IX Header "AUTHOR" Markus Benning .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2014 by Markus Benning . .PP This is free software, licensed under: .PP .Vb 1 \& The GNU General Public License, Version 2, June 1991 .Ve