FAQ
Howdy, I'm seeing the following oddity with header_filter_rules.

I have 2 rules set up. For a given test message, Rule 1 does not match,
and Rule 2 does. If I have Rule 1 set to discard, and Rule 2 set to Hold,
the message is discarded. If I make the single change of setting Rule 2 to
Defer, then the message is accepted.

Any idea why the Action for Rule 1 is being used when Rule 2 is hit? Can
anyone else reproduce this? Am I misunderstanding something about Rule
processing order?

Using Mailman 2.1.9

Thanks.

-David

Search Discussions

  • Mark Sapiro at May 22, 2007 at 11:53 pm

    David R Bosso wrote:
    I have 2 rules set up. For a given test message, Rule 1 does not match,
    and Rule 2 does. If I have Rule 1 set to discard, and Rule 2 set to Hold,
    the message is discarded. If I make the single change of setting Rule 2 to
    Defer, then the message is accepted.

    And did you by any chance try setting rule 2's action back to Hold and
    testing again? The reason I ask, is that when you "Add new item" via
    the web GUI, a rule gets created with a flag indicating it is 'empty'
    and this flag isn't tested in processing. It shouldn't matter because
    either this empty slot will be filled in or it's action remains
    'defer', but I may be missing something.

    Any idea why the Action for Rule 1 is being used when Rule 2 is hit?

    No.

    Can
    anyone else reproduce this? Am I misunderstanding something about Rule
    processing order?

    I think your understanding is correct. I haven't tried to duplicate it.

    Using Mailman 2.1.9
    From source or a package? If a package, which?

    Can you provide the contents of header_filter_rules, ideally from the
    output of

    bin/dumpdb lists/<listname>/config.pck

    or

    bin/config_list -o filename listname

    but barring that, a copy/paste from the web interface, and a copy of
    the test message that illustrates the problem.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • David R Bosso at May 23, 2007 at 5:58 pm

    --On May 22, 2007 4:53:05 PM -0700 Mark Sapiro wrote:

    David R Bosso wrote:
    I have 2 rules set up. For a given test message, Rule 1 does not match,
    and Rule 2 does. If I have Rule 1 set to discard, and Rule 2 set to
    Hold, the message is discarded. If I make the single change of setting
    Rule 2 to Defer, then the message is accepted.

    And did you by any chance try setting rule 2's action back to Hold and
    testing again? The reason I ask, is that when you "Add new item" via
    the web GUI, a rule gets created with a flag indicating it is 'empty'
    and this flag isn't tested in processing. It shouldn't matter because
    either this empty slot will be filled in or it's action remains
    'defer', but I may be missing something.
    Thanks for offering to help. Yes, I can go back and forth with consistent
    results.

    [snip]
    Using Mailman 2.1.9

    From source or a package? If a package, which?
    Gentoo's ebuild from portage.
    Can you provide the contents of header_filter_rules, ideally from the
    output of

    bin/dumpdb lists/<listname>/config.pck
    'header_filter_rules': [ ( '^Return-Path:
    (?!(<dbosso at lsit\\.ucsb\\.edu>))',
    3,
    False),
    ('^Subject: test', 7, False)],

    or

    bin/config_list -o filename listname

    but barring that, a copy/paste from the web interface
    ^Return-Path: (?!(<dbosso at lsit\.ucsb\.edu>))

    ^Subject: test
    and a copy of
    the test message that illustrates the problem.
    A mail from me (rule 1 does not match), with the subject "test".

    Thanks.

    -David

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Mark Sapiro at May 24, 2007 at 12:59 am

    David R Bosso wrote:
    Thanks for offering to help. Yes, I can go back and forth with consistent
    results.

    Thanks for providing the info I asked for. I will definitely look into
    this unless someone else solves it in the mean time, but I will not be
    able to spend any time on it before next week.

    Be assured that I won't forget.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Mark Sapiro at Jun 1, 2007 at 6:32 pm

    David R Bosso wrote:
    --On May 22, 2007 4:53:05 PM -0700 Mark Sapiro wrote:
    David R Bosso wrote:
    I have 2 rules set up. For a given test message, Rule 1 does not match,
    and Rule 2 does. If I have Rule 1 set to discard, and Rule 2 set to
    Hold, the message is discarded. If I make the single change of setting
    Rule 2 to Defer, then the message is accepted.
    Can you provide the contents of header_filter_rules, ideally from the
    output of

    bin/dumpdb lists/<listname>/config.pck
    'header_filter_rules': [ ( '^Return-Path:
    (?!(<dbosso at lsit\\.ucsb\\.edu>))',
    3,
    False),
    ('^Subject: test', 7, False)],
    and a copy of
    the test message that illustrates the problem.
    A mail from me (rule 1 does not match), with the subject "test".

    Sorry for the long delay in following up. I have tried to duplicate this
    and I can't. I have the exact header_filter_rules as above and I send a
    message from me (also doesn't match rule 1) with 'Subject: test' and it
    is held by rule 2.

    I have tested with both the current SpamDetect.py rev 8146 and the 2.1.9
    base rev 7750 with the same result. See
    <http://mailman.svn.sourceforge.net/viewvc/mailman/branches/Release_2_1-maint/mailman/Mailman/Handlers/SpamDetect.py?view=log>
    for more including the source of these.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • David R Bosso at Jun 3, 2007 at 1:42 pm

    --On Friday, June 1, 2007 11:32 AM -0700 Mark Sapiro wrote:

    David R Bosso wrote:
    --On May 22, 2007 4:53:05 PM -0700 Mark Sapiro wrote:
    David R Bosso wrote:
    I have 2 rules set up. For a given test message, Rule 1 does not
    match, and Rule 2 does. If I have Rule 1 set to discard, and Rule 2
    set to Hold, the message is discarded. If I make the single change
    of setting Rule 2 to Defer, then the message is accepted.
    Can you provide the contents of header_filter_rules, ideally from the
    output of

    bin/dumpdb lists/<listname>/config.pck
    'header_filter_rules': [ ( '^Return-Path:
    (?!(<dbosso at lsit\\.ucsb\\.edu>))',
    3,
    False),
    ('^Subject: test', 7, False)],
    and a copy of
    the test message that illustrates the problem.
    A mail from me (rule 1 does not match), with the subject "test".

    Sorry for the long delay in following up. I have tried to duplicate this
    and I can't. I have the exact header_filter_rules as above and I send a
    message from me (also doesn't match rule 1) with 'Subject: test' and it
    is held by rule 2.
    [whoops. sent this to the list with the wrong address the first time]

    Rule 1 is (I thought) Match Return-Path:, only if it's not followed by
    dbosso at lsit.ucsb.edu. This should discard for any Return Path but my email
    address, did you modify it to match yours, or do I have the (?!...) syntax
    wrong?

    -David
    I have tested with both the current SpamDetect.py rev 8146 and the 2.1.9
    base rev 7750 with the same result. See
    <http://mailman.svn.sourceforge.net/viewvc/mailman/branches/Release_2_1-m
    aint/mailman/Mailman/Handlers/SpamDetect.py?view=log> for more including
    the source of these.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Mark Sapiro at Jun 3, 2007 at 4:56 pm

    David R Bosso wrote:
    Rule 1 is (I thought) Match Return-Path:, only if it's not followed by
    dbosso at lsit.ucsb.edu. This should discard for any Return Path but my email
    address, did you modify it to match yours, or do I have the (?!...) syntax
    wrong?

    My mistake. I didn't really look at the Rule 1 pattern. The pattern is
    correct for what you want and it works. It didn't discard my test
    messages because my test setup uses Exim and Exim's pipe driver
    doesn't add a Return-Path: header, so rule 1 didn't match because
    there was no Return-Path: at all.

    I retested using bin/inject to deliver the messages. A message with

    Return-path: <msapiro at value.net>
    Subject: test

    was discarded by rule 1. A message with

    Return-path: <dbosso at lsit.ucsb.edu>
    Subject: test

    was held by rule 2, so I am still unable to duplicate the problem.

    What's in Mailman's vette log for the discarded message that should be
    held by rule 2?

    If that doesn't offer a clue, I suggest you get
    <http://mailman.svn.sourceforge.net/viewvc/*checkout*/mailman/branches/Release_2_1-maint/mailman/Mailman/Handlers/SpamDetect.py?revisionw50>
    and compare it to your Mailman/Handlers/SpamDetect.py to see if there
    is any difference.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • John Bell at Jun 3, 2007 at 6:10 pm
    In FAQ 3.11 it mentions how to do the following:

    Features: Members join by filling in a form on your website (and replying to
    the confirmation email). They will be sent a welcome message that does not
    mention how to post to the list. They will receive your newsletters, with a
    footer that gives simple instructions for unsubscribing. Only authorized
    persons can post to the list (send the newsletters). (Note: For this FAQ we
    are discussing how to setup an announcement list for a band.)

    The post assumes that you have access to the command line. I'm website
    owner, and my host has set up the mailman feature, but I can only access the
    HTML admin pages to configure my mailing list. I don't have access to the
    source code or command line features. Like others, I want a one-way
    notification system - only I send messages to folks who want to join my
    mailing list to get news, etc, about my site.

    I found a workaround to both HTML and emails, but it's a but sneaky. So here
    is information for whom it may concern, and if appropriate perhaps someone
    could update the FAQ page. If I've done something completely unnessary and
    there's a simpler way to do this please also let me know.

    ---

    The following is a guide to setting up a newsletter type mailing list
    bypassing all HTML and emails from mailman to subscribers when they
    subscribe and unsubscribe. The only requirement is that you are able to
    create your own CGI scripts. I did this is perl and I assume this is also
    possible with other languages.

    First I went through all the options to ensure that a subscribing person
    would not get any email when they subscribed or unsubscribed, or due to
    other events. This is how I set it up (for the version I have, 2.1.9):

    All the following I set to no in general options:

    -Send password reminders
    - Send monthly password reminders
    - Send welcome message to newly subscribed members
    - Send goodbye message to members when they are unsubscribed
    - Send mail to poster when their posting is held for approval

    All the following is set to yes in general options:

    - Should the list moderators get immediate notice of new requests, as well
    as daily notices about collected ones
    - Should administrator get notices of subscribes and unsubscribes
    - Emergency moderation of all list traffic [probably not necessary but I'm
    paranoid]

    Under Privacy Options, subscription rules,

    - What steps are required for subscription = Require approval
    - Is the list moderator's approval required for unsubscription requests? Yes

    These last two seemed to stop all emails when subscribing or unsubscribing -
    you as the moderator will get them all. However as you're also the only one
    sending out emails to the list this doesn't matter. Before sending anything,
    process all the requests, then send the message.

    The second step is to hide all the mailman HTML. I did this by creating my
    own perl script. On my own HTML page I have a simple form as follows
    (stripping all the formatting):

    <form action="/cgi-bin/subscribe.cgi" method="POST">
    <input type="text" size="25" name="email">
    <input type="radio" name="status" value="subscribe" checked>
    <input type="radio" name="status" value="unsubscribe">
    <input type="submit" value=" Submit ">
    </form>

    I.e. two parameters - email and status.

    The perl script 'subscribe.cgi' then does the following:

    If the user wants to subscribe I execute these lines:

    use LWP::Simple; [place at the top of the file]

    $link = "http://[my URL]/mailman/subscribe/[my mailman
    listname]?email=".$FORM{'email'}."\&email-button=Subscribe";
    $webpage = get($link);

    And to unsubscribe:

    $link = "http://[my URL]/mailman/options/[my mailman
    listname]?email=".$FORM{'email'}."\&login-unsub=Unsubscribe";
    $webpage = get($link);

    In other words, the script gets the page - executing the command, and
    instead of displaying the reulting HTML it gets captured by the variable
    $webpage which I can parse to display as I want, or ignore completely and do
    my own thing.

    Comments welcome!



    ----- Original Message -----
    From: "Mark Sapiro" <msapiro at value.net>
    To: "David R Bosso" <dbosso+lists.mailman at lsit.ucsb.edu>;
    <mailman-users at python.org>
    Sent: Sunday, June 03, 2007 9:56 AM
    Subject: Re: [Mailman-Users] multiple header_filter_rules?

    David R Bosso wrote:
    Rule 1 is (I thought) Match Return-Path:, only if it's not followed by
    dbosso at lsit.ucsb.edu. This should discard for any Return Path but my
    email
    address, did you modify it to match yours, or do I have the (?!...) syntax
    wrong?

    My mistake. I didn't really look at the Rule 1 pattern. The pattern is
    correct for what you want and it works. It didn't discard my test
    messages because my test setup uses Exim and Exim's pipe driver
    doesn't add a Return-Path: header, so rule 1 didn't match because
    there was no Return-Path: at all.

    I retested using bin/inject to deliver the messages. A message with

    Return-path: <msapiro at value.net>
    Subject: test

    was discarded by rule 1. A message with

    Return-path: <dbosso at lsit.ucsb.edu>
    Subject: test

    was held by rule 2, so I am still unable to duplicate the problem.

    What's in Mailman's vette log for the discarded message that should be
    held by rule 2?

    If that doesn't offer a clue, I suggest you get
    <http://mailman.svn.sourceforge.net/viewvc/*checkout*/mailman/branches/Release_2_1-maint/mailman/Mailman/Handlers/SpamDetect.py?revisionw50>
    and compare it to your Mailman/Handlers/SpamDetect.py to see if there
    is any difference.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan

    ------------------------------------------------------
    Mailman-Users mailing list
    Mailman-Users at python.org
    http://mail.python.org/mailman/listinfo/mailman-users
    Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
    Searchable Archives:
    http://www.mail-archive.com/mailman-users%40python.org/
    Unsubscribe:
    http://mail.python.org/mailman/options/mailman-users/john.r.bell%40cox.net

    Security Policy:
    http://www.python.org/cgi-bin/faqw-mm.py?req=show&amp;fileúq01.027.htp

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedMay 22, '07 at 6:25p
activeJun 3, '07 at 6:10p
posts8
users3
websitelist.org

People

Translate

site design / logo © 2021 Grokbase