procmail
[Top] [All Lists]

Re: Auto-forwarding recipe problem

2010-09-01 19:39:20
Hi Rich,

On 02/09/10 11:15, RGBall wrote:
Greg Trounson wrote:

Hi, and thanks for your reply,

I implemented both of your suggested changes above, and so far at least
they appear to have worked. That's great, though a little troubling, as
I'm still at a loss as to what was causing some messages to slip through
before.

I will need to do further tweaking, as the FROM line had the [\(_dot_)(_at_)]
directive there to match for example both sender1(_at_)my(_dot_)domain and
sender2(_at_)division(_dot_)my(_dot_)domain(_dot_) That could have been what 
was tripping it up,
though it still looks to be a valid egrep expression.

You keep changing the criteria and you haven't put up the actual recipe
along with a verbose log of a failure. Doing the latter is the first
thing to do if you want anything except casual help.

I'm not sure what you mean. The only criteria change was at the recommendation of someone on this list trying to help with my problem. I posted my original recipe in my first post in this thread. Here it is with the suggested modifications:

PATH=$HOME/bin:/usr/bin:/usr/local/bin:.
MAILDIR=$HOME/Maildir      # Need to make sure it exists
DEFAULT=$MAILDIR/
LOGFILE=$MAILDIR/procmailLog
LOCKFILE=$HOME/.lockmail

# Discard potential mail loops
:0
* ^X-Loop:(_dot_)*user1(_at_)my\(_dot_)domain\(_dot_)com
/dev/null

:0
* ^From:(_dot_)*(_at_)my\(_dot_)domain\(_dot_)com
* ! ^SUBJECT.*confidential
{
 :0 fwh
 # Write loop header by piping through formail, to avoid mail loops
 | formail -A "X-Loop: user1(_at_)my(_dot_)domain(_dot_)com"

 :0 c
 # Send a copy, then (c)ontinue processing actions
 ! user2(_at_)my(_dot_)domain(_dot_)com

 :0:
 # Send to default location (with a lockfile)
 ${DEFAULT}
}

As far as I can tell there is no log of the failure. In this case the "failure" is the fact that some messages that do not match the criteria are being passed to the action stage. The procmail log (Maildir/procmaillog) says nothing about forwarding. I have just now enabled verbose logging (VERBOSE=yes in my procmailrc) so will see what that says. Thanks for the prompt to do so.

There is nothing about

^FROM(_dot_)*[\(_dot_)(_at_)]my\(_dot_)domain\(_dot_)com

which is appropriate to match sender1(_at_)my(_dot_)domain and
sender2(_at_)division(_dot_)my(_dot_)domain

Again, I'm not sure what you mean by this. As I understand it criteria are evaluated as case-insensitive egrep expressions, so I tested them thusly:

$ echo "From: sender1(_at_)my(_dot_)domain(_dot_)com" | egrep -i "^FROM(_dot_)*[\(_dot_)(_at_)]my\(_dot_)domain\(_dot_)com"
From: sender1(_at_)my(_dot_)domain(_dot_)com
$ echo "From: sender2(_at_)division(_dot_)my(_dot_)domain(_dot_)com" | egrep -i "^FROM(_dot_)*[\(_dot_)(_at_)]my\(_dot_)domain\(_dot_)com"
From: sender2(_at_)division(_dot_)my(_dot_)domain(_dot_)com
$ echo "From: sender3(_at_)some(_dot_)other(_dot_)domain" | egrep -i "^FROM(_dot_)*[\(_dot_)(_at_)]my\(_dot_)domain\(_dot_)com"
$

It'd be a good idea to create a sandbox so you can test your recipes
against known messages. Take a look at Sean's method:

http://www.professional.org/procmail/sandbox.html

Thanks, I'll take a look at that.

Greg

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>