On Mon, Mar 11, 2019 at 09:28:40PM +0100, Ralph Seichter wrote:

> I'm having trouble with Rspamd as a milter for Postfix, specifically
> with Rspamd's discard action:
> 
>   # /etc/rspamd/local.d/force_actions.conf
>   rules {
>     FOO_RULE {
>       expression = 'FOO_EXPR',
>       action = 'discard'
>     }
>   }

When do you trigger than rule?  Postfix supports 'discard', but only
after "MAIL FROM", not after CONNECT or EHLO.

            /*
             * Decision: accept and silently discard this message. According
             * to the milter API documentation there will be no action when
             * this is requested by a connection-level function. This
             * decision is final (i.e. Sendmail 8 changes receiver state).
             */
        case SMFIR_DISCARD:
            if (data_size != 0)
                break;
            if (IN_CONNECT_EVENT(event)) {
                msg_warn("milter %s: DISCARD action is not allowed "
                         "for connect or helo", milter->m.name);
                MILTER8_EVENT_BREAK(milter->def_reply);
            } else {
                /* No more events for this message. */
                milter->state = MILTER8_STAT_ACCEPT_MSG;
                MILTER8_EVENT_BREAK("D");
            }

-- 
        Viktor.

Reply via email to