This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Actions based on milter macros

Hello,

I'm running Puremessage for Unix as a milter for Sun Messaging Server. Is it possible to check values of certain milter macros? Specifically, Sun Messaging Server sets {optin} macro for the messages and I'd like to check the value of it in the policy.

If that's not possible, what options do I have to pass information from SJMS to Puremessage? I tried to add a custom header but it seems that the milter checks get done before the addition of the header.

:4318


This thread was automatically locked due to age.
Parents
  • Hi Mark,

    Thanks for the support. 

    Yes, I did modify the source. I replaced pmx_mta_macro function in PureMessage/Policy/Base.pm with this:

    sub pmx_mta_macro {
        my $msg   = shift;
        my $args  = shift;
        my $name  = $args->param(0)->[0];
        my $value = $args->param(1)->[0];
    
        if (grep {"macro_$name" eq $_} $msg->attrs) {
            $args->tag('contains') and return 1 + index($msg->get_attr("macro_$name"), $value);
            $args->tag('matches') and warn "pmx_mta_macro: ':matches' not implemented (only :is and :contains)";
            $args->tag('re') and warn "pmx_mta_macro: ':re' not implemented (only :is and :contains)";
            return ($msg->get_attr("macro_$name") eq $value);
        }
        return 0;
    }

     then, I added  tag_set = "MATCH-TYPE" into  <test pmx_mta_macro> in file etc/data/policy/base.conf.

    Now I'm able to check a macro value in policy.siv, e.g.

    if pmx_mta_macro :contains "optin" "spam" { ...

    How can I file an RFE?

    :4411
Reply
  • Hi Mark,

    Thanks for the support. 

    Yes, I did modify the source. I replaced pmx_mta_macro function in PureMessage/Policy/Base.pm with this:

    sub pmx_mta_macro {
        my $msg   = shift;
        my $args  = shift;
        my $name  = $args->param(0)->[0];
        my $value = $args->param(1)->[0];
    
        if (grep {"macro_$name" eq $_} $msg->attrs) {
            $args->tag('contains') and return 1 + index($msg->get_attr("macro_$name"), $value);
            $args->tag('matches') and warn "pmx_mta_macro: ':matches' not implemented (only :is and :contains)";
            $args->tag('re') and warn "pmx_mta_macro: ':re' not implemented (only :is and :contains)";
            return ($msg->get_attr("macro_$name") eq $value);
        }
        return 0;
    }

     then, I added  tag_set = "MATCH-TYPE" into  <test pmx_mta_macro> in file etc/data/policy/base.conf.

    Now I'm able to check a macro value in policy.siv, e.g.

    if pmx_mta_macro :contains "optin" "spam" { ...

    How can I file an RFE?

    :4411
Children
No Data