Next: , Previous: listserv_getmail_template, Up: Functions Reference


9.5 listserv_content_filter

— Function: struct listserv_content_filter** listserv_getcontent_filter (struct listserv *l, const char *listname);

The function retrieves the actual CONTENT_FILTER mail template for listname, parses it, and returns the results in a NULL-rerminated array of struct listserv_content_fitler*s . The match type, specified by singe or double colon after the header-field, is always "IS". When a header is supposed to "CONTAIN" something, listserv_content_filter inserts asterisks (*) at the begin and at the end of header-value.

E.g. if CONTENT_FILTER is

            X-Friends: Yes
            Action: Allow
            X-Spam:: Yes
            Action: REJECT This is spam

the return values are

            { /*first rule */ {
              "X-Friends"    /* header-field */,
              "*Yes*"        /* header-value */,
              NULL,          /* there is no text after allow */
              'A'            /* ACTION ALLOW */ },
              /* second rule */ {
              "X-Friends"    /* header-field */,
              "Yes"          /* header-value */,
              "This is spam" /* rejection reason */,
              'R'            /* ACTION REJECT */ }
          }