Pegasus Mail & Mercury

Welcome to the Community for Pegasus Mail and
The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
Welcome to Pegasus Mail & Mercury Sign in | Join | Help
in
Home Blogs Forums Downloads Pegasus Mail Overview Mercury Overview Wiki

mail filtering rules

Last post 03-23-2020, 14:16 by Shades. 6 replies.
Sort Posts: Previous Next
  •  03-21-2020, 1:30

    • R. Davis is not online. Last active: 03-24-2020, 23:59 R. Davis
    • Top 150 Contributor
    • Joined on 05-09-2011
    • Member
    • Points 685

    mail filtering rules

    I strongly suspect this is some oversight on my part, but:

    I have written a mail filtering rule that searches for the string 

    Return-Path: <myemailaddress>

    as I've been getting a bunch of spam from invented addresses (so can't block on From), but this setting of return path to my own mailbox is a giveaway.

    I've got a regular expression rule with the string above (myemailaddress of course replaced by the right string), searching Headers only, action is to move the matching msg to a spam folder. Rule is enabled and is in  New mail filtering rules, Rules applied when folder is opened. Yet nothing happens. I've got unread msgs with the relevant string as the first header, yet nothing gets moved. I'm using version 4.72.572

    Tried quoting the string just in case, but no luck.

    What might I be doing wrong? Just want the sucker to fire and move aside this category of spam.

     thanks for any advice

  •  03-21-2020, 3:41

    • Brian Fluet is not online. Last active: 04-08-2020, 19:19 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 29,835

    Re: mail filtering rules

    My first thought is that there is a problem with the move.  If you typed in the destination folder name, redo it using the Set button.

    If that isn't it, here is a process I would follow to troubleshoot:

    • Since the current rule isn't working, delete it and start fresh (new mail filtering rule, expression, headers only).
    • If you have a number of rules, make this rule the very first one during troubleshooting to rule out interference by another rule.
    • Copy the Return-Path header from a message and paste it into this rule.  Be sure not to inadvertently add a leading or trailing space.
    • Set the action to "Set message colour" and pick a color.  You can change it to Move once done troubleshooting.
    • Add an 'always exit' rule as the second rule to insure processing is isolated to just the first rule. 
    • Save the rule set.
    • Close then open the new mail folder and check for the color change.
    • If you don't see the color, something is wrong with the expression.
    • Once you see color, change the rule sequence as desired if you don't want this one at the top (keep the following 'always exit' rule).  Change the color, then test again.
    • If still good, remove the 'always exit' rule, change the color, test again.
    • If still good, change the action to Move, then test again. 
    • A failure here indicates a problem with the move not with the filter so create a new folder and set the move destination to it.
    Based on your original post it appears that you know that only unread messages are processed through the new mail filter rules.  It occurs as they arrive and each time the new mail folder is opened.
     
  •  03-21-2020, 7:59

    • Shades is not online. Last active: 03-27-2020, 8:07 Shades
    • Top 100 Contributor
    • Joined on 06-16-2007
    • Member
    • Points 875

    Re: mail filtering rules

    It could help if you post the relevant line(s) from Winrules.pmc, or failing that compare with my example (note the“*” which are required)

    If expression headers matches "Return-Path:*A_N_Other@SomeWhere.com*" Move "28TU9BFY:7A82:FOL09E46"

  •  03-21-2020, 21:08

    • irelam is not online. Last active: 04-08-2020, 22:15 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 22,735
    • BetaTeam Moderator

    Re: mail filtering rules

    I would suggest you place a space character after the first colon, to be followed by the asterisk.  The asterisk is going to promote the blanks for all previous characters,

    ie:  If expression headers matches "Return-Path: *A_N_Other@SomeWhere.com*"

    Martin

  •  03-22-2020, 23:55

    • R. Davis is not online. Last active: 03-24-2020, 23:59 R. Davis
    • Top 150 Contributor
    • Joined on 05-09-2011
    • Member
    • Points 685

    Re: mail filtering rules

    Thanks to all three of you for your suggestions.

    Brian -- you are right of course about decomposing the problem to find the error. Did what you said and clearly the match is not working.

    Here's WINRULES.PMC, which has only the single rule in it:


    NoDisplay:New mail filtering rules
    If expression headers matches "Return-Path: *XXXXX@mit.edu*" Highlight "3"
     

    I did what the second 2 suggestions indicated, the asterisks and the space after the colon. Still no joy (ie no header color change). I have the feeling I'm overlooking something obvious. Example: Is there any sort of global switch that affects whether these rules are run?

     

    Many thanks.

     

  •  03-23-2020, 0:38

    • Brian Fluet is not online. Last active: 04-08-2020, 19:19 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 29,835

    Re: mail filtering rules

    I just did a quick test that worked by creating a new expression filter and copying and pasting the Return-Path header from the raw view of an existing message.  No astersisks needed.

    The only requirements that I can think of are that the filter be an on open new message filtering rule, that the target message be in the new mail folder and marked as unread, and that the new mail folder be closed then opened to trigger processing.

  •  03-23-2020, 14:16

    • Shades is not online. Last active: 03-27-2020, 8:07 Shades
    • Top 100 Contributor
    • Joined on 06-16-2007
    • Member
    • Points 875

    Re: mail filtering rules

    I did the same (by editing my Winrules.pmc) using the rule the OP gave, with a Return-Path address from a post in my folders,

    moved to NMF,

    marked unread,

    when Pegasus was re-started it got coloured

     

     

     

View as RSS news feed in XML

Contact | Advertise | Host provider: PraktIT | Terms of Use | Privacy Statement
Copyright © 2007-2011 David Harris / Peter Strömblad. | Pegasus Mail Home Page