"unmatched" test in nested rules does not behave as documented
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
fdm (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have been trying to use the "unmatched" test in a nested rule as follows:
action "digest" {
action "inbox"
}
match "^List-
match not in-cache $digdb key "%1" action "digest"
match unmatched action drop
}
(The idea being to deliver only the first copy of a message from a particular list to the inbox.)
The man page says:
"The inner rules will not be evaluated unless the outer one matches. Rules may be multiply nested. Note that the outer rule does not count as a match for the purposes of the matched and unmatched conditions."
However, looking at the source in mail-state.c:
...
/* If the result was false, skip to find the next rule. */
if (!mctx->result)
/*
* If this rule is stop, mark the context so when we get back after
* delivery we know to stop.
*/
if (mctx->rule->stop)
/* Handle nested rules. */
if (!TAILQ_
...
The "mctx->matched=1" line marks the message as matched when the outer rule matches, and it is not obviously cleared anywhere, contradicting the documentation..
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: fdm 1.6-2
ProcVersionSign
Uname: Linux 2.6.32-45-generic i686
Architecture: i386
Date: Tue Nov 20 11:01:28 2012
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100427.1)
ProcEnviron:
PATH=(custom, user)
LANG=en_GB.utf8
SHELL=/bin/bash
SourcePackage: fdm
Reported to upstream:
https:/ /sourceforge. net/tracker/ ?func=detail& aid=3588717& group_id= 174568& atid=869744