[opensuse] procmail rule confusion [OFF TOPIC]
I am using procmail to filter mail I receive from OBS into imap folders. I have a few places where the sorting goes wrong, and for the life of me I cannot see why. Consider these two rules (in the procmail config file in this order): :0 * ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2* ".Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_2/" :0 * ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.3_Update* ".Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_3_Update/" Now consider a message with this subject line: Subject: Build success of home:rogeroberholtzer/universe openSUSE_11.3_Update/x86_64 I want the message to trigger the second rule. But, based on where the message winds up, it is triggering the first rule. Consistently. The subject does not even contain the character '2'! How can it trigger the first rule? The log file says this for the message:
From hermes@opensuse.org Thu Apr 28 04:51:48 2011 Subject: Build success of home:rogeroberholtzer/universe openSUSE_11.3_Update/ Folder: .Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_2/new/13 1617
So I am fairly certain that it is procmail that is messing up. I have many rules like this, but a few related to my sorting of the build service have this issue. Whatever the issue is. I have banged ny head against this, but nothing seems to help. Am I blind (again...)? Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2011-04-28 08:22, Roger Oberholtzer wrote: Add: VERBOSE=on
:0 * ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2* ".Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_2/"
:0 * ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.3_Update* ".Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_3_Update/"
VERBOSE=off - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk25M6oACgkQtTMYHG2NR9V1jQCdFwo2/l7Zmh8TD1uEwl7EIzQr Mc8AniL5M+50OjgxyZrRBkTmOwZXpKk1 =WkqP -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 28 April 2011, Roger Oberholtzer wrote:
I am using procmail to filter mail I receive from OBS into imap folders. I have a few places where the sorting goes wrong, and for the life of me I cannot see why.
Stupid question: If you use IMAP, do you use Cyrus? If so, why don't you use SIEVE? With SmartSIEVE there would even be a very comfortable frontend. -S -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ Heckler & Koch - the original point and click interface
On Thu, 2011-04-28 at 14:22 +0300, Stefan Gofferje wrote:
On Thursday 28 April 2011, Roger Oberholtzer wrote:
I am using procmail to filter mail I receive from OBS into imap folders. I have a few places where the sorting goes wrong, and for the life of me I cannot see why.
Stupid question: If you use IMAP, do you use Cyrus? If so, why don't you use SIEVE? With SmartSIEVE there would even be a very comfortable frontend.
I use Courier. It has worked great for our needs, so I have not felt the need to change. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Roger Oberholtzer
:0 * ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2* ".Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_2/"
:0 * ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.3_Update* ".Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_3_Update/"
Now consider a message with this subject line:
Subject: Build success of home:rogeroberholtzer/universe openSUSE_11.3_Update/x86_64
I want the message to trigger the second rule. But, based on where the message winds up, it is triggering the first rule. Consistently. The subject does not even contain the character '2'! How can it trigger the first rule? The log file says this for the message:
From hermes@opensuse.org Thu Apr 28 04:51:48 2011 Subject: Build success of home:rogeroberholtzer/universe openSUSE_11.3_Update/ Folder: .Lists.SUSE Novell.OpenSuseBuildService.openSUSE_11_2/new/13 1617
So I am fairly certain that it is procmail that is messing up.
reverse the order of the two recipies so 11.3 comes first and drop the trailing "*" from both. ie: :0 * ^From:.*hermes@opensuse.org * ^Subject:.*openSUSE_11\.3_Update "Lists..../ :0 * ^From:.*hermes@opensuse.org * ^Subject:.*openSUSE_11\.2 "Lists..../ btw, procmail recipies are *not* case sensitive unless you flag them as such and recipies match *anything* trailing the specified so the asterisk is superfulous to see what is causing your confusion, do as Carlos suggested, add "Verbose ON" above the subject recipies and "Verbose OFF" below, then check your logs after a post is delivered to an undesired location. You might also try your recipies within a "sandbox" to test, see: http://www.professional.org/procmail/disclaimer.html -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 08:18 -0400, Patrick Shanahan wrote:
to see what is causing your confusion, do as Carlos suggested, add "Verbose ON" above the subject recipies and "Verbose OFF" below, then check your logs after a post is delivered to an undesired location.
I'm going to start with simply being verbose. Next time OBS does a build, I will see. Being the good OBS citizen I am, I will not trigger a build by hand just to test this :) Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 28 April 2011 08:22:15 Roger Oberholtzer wrote:
I am using procmail to filter mail I receive from OBS into imap folders. I have a few places where the sorting goes wrong, and for the life of me I cannot see why.
Consider these two rules (in the procmail config file in this order): :0
* ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2*
Shouldn't there be a dot before the 2? I'm not sure if procmail uses regular expressions, but if it does that means "0 or more instances of '2'" and would match openSUSE_11. regardless of what follows, no? Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 14:44 +0200, Anders Johansson wrote:
On Thursday 28 April 2011 08:22:15 Roger Oberholtzer wrote:
I am using procmail to filter mail I receive from OBS into imap folders. I have a few places where the sorting goes wrong, and for the life of me I cannot see why.
Consider these two rules (in the procmail config file in this order): :0
* ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2*
Shouldn't there be a dot before the 2? I'm not sure if procmail uses regular expressions, but if it does that means "0 or more instances of '2'" and would match openSUSE_11. regardless of what follows, no?
Hmm. I was expecting the \. to be an escaped period. Meaning that a literal period is needed to make a match. The period in the rule string should have no special regexp meaning and be satisfied only by a literal period at that place in the test string. Did I get this wrong? Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 14:55 +0200, Roger Oberholtzer wrote:
* ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2*
Shouldn't there be a dot before the 2? I'm not sure if procmail uses regular expressions, but if it does that means "0 or more instances of '2'" and would match openSUSE_11. regardless of what follows, no?
Hmm. I was expecting the \. to be an escaped period. Meaning that a literal period is needed to make a match. The period in the rule string should have no special regexp meaning and be satisfied only by a literal period at that place in the test string. Did I get this wrong?
Anders actually meant to have a . AFTER the 2, not before. .* represents 'any character, any number of times, including 0 times) --> ^Subject:.*openSUSE_11\.2.* \. means a literal dot, . means 'anything' Note: you have the same construct after Subject:.* => Any character after subject, how ever often. Dominique -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Dimstar / Dominique Leuenberger
On Thu, 2011-04-28 at 14:55 +0200, Roger Oberholtzer wrote:
* ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2*
Shouldn't there be a dot before the 2? I'm not sure if procmail uses regular expressions, but if it does that means "0 or more instances of '2'" and would match openSUSE_11. regardless of what follows, no?
Hmm. I was expecting the \. to be an escaped period. Meaning that a literal period is needed to make a match. The period in the rule string should have no special regexp meaning and be satisfied only by a literal period at that place in the test string. Did I get this wrong?
Anders actually meant to have a . AFTER the 2, not before. .* represents 'any character, any number of times, including 0 times) --> ^Subject:.*openSUSE_11\.2.*
\. means a literal dot, . means 'anything'
Note: you have the same construct after Subject:.* => Any character after subject, how ever often.
Matching *anything* trailing the specified recipie is the default in procmail, ie: the regex to match trailing information is superfulous. * ^Subject:.*openSUSE_11\.2 and * ^Subject:.*opensuse_11\.2* will match the same lines. Promail is not case sensitive unless the recipie is flagged as such and the matching regex does not consider anything following the regex. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 28 April 2011 15:18:20 Patrick Shanahan wrote:
* ^Subject:.*openSUSE_11\.2 and * ^Subject:.*opensuse_11\.2*
I don't think so. There is a difference between 2.* and 2* in the world of regular expressions. One means "a 2 followed by 0 or more characters", the other means "0 or more '2' characters" Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 15:22 +0200, Anders Johansson wrote:
On Thursday 28 April 2011 15:18:20 Patrick Shanahan wrote:
* ^Subject:.*openSUSE_11\.2 and * ^Subject:.*opensuse_11\.2*
I don't think so. There is a difference between 2.* and 2* in the world of regular expressions. One means "a 2 followed by 0 or more characters", the other means "0 or more '2' characters"
What I want is to require a single 2, followed by any or no more characters. So, the earlier suggestion of removing the trailing '*' as in: * ^Subject:.*openSUSE_11\.2 would require "11.2" for a match. Anything after the 2 is irrelevant, but the '2' must be present. Could this trailing '*' be the source of the problem, and not just an unnecessary spec for the rest of the string after the chars marched in the previous part of the rule? Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 28 April 2011 16:36:50 Roger Oberholtzer wrote:
would require "11.2" for a match. Anything after the 2 is irrelevant, but the '2' must be present. Could this trailing '*' be the source of the problem, and not just an unnecessary spec for the rest of the string after the chars marched in the previous part of the rule?
Your string was 11\.2* and this matches 11. followed by absolutely anything at all. This is why it matched on 11.3. You need either 11\.2 or 11\.2.* - note the extra dot before the asterisk Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 16:39 +0200, Anders Johansson wrote:
On Thursday 28 April 2011 16:36:50 Roger Oberholtzer wrote:
would require "11.2" for a match. Anything after the 2 is irrelevant, but the '2' must be present. Could this trailing '*' be the source of the problem, and not just an unnecessary spec for the rest of the string after the chars marched in the previous part of the rule?
Your string was 11\.2* and this matches 11. followed by absolutely anything at all. This is why it matched on 11.3.
You need either 11\.2 or 11\.2.* - note the extra dot before the asterisk
OK. I will try that. The 'funny' thing is that I bet I have this in a number of other places in my rules. But since the strings are less similar, the error never surfaced. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 16:39 +0200, Anders Johansson wrote:
On Thursday 28 April 2011 16:36:50 Roger Oberholtzer wrote:
would require "11.2" for a match. Anything after the 2 is irrelevant, but the '2' must be present. Could this trailing '*' be the source of the problem, and not just an unnecessary spec for the rest of the string after the chars marched in the previous part of the rule?
Your string was 11\.2* and this matches 11. followed by absolutely anything at all. This is why it matched on 11.3.
You need either 11\.2 or 11\.2.* - note the extra dot before the asterisk
I think this was the issue. 11\.2.* is what I needed. Not 11\.2* In another post I claimed I probably had the wrong usage throughout my rules file but was lucky. That seems not to be the case. The usage was correct. When I added the set of rules for messages from OBS, I messed up. Seems I forgot something I once knew. Again... Thanks for the help! Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, Apr 29, 2011 at 09:38:26AM +0200, Roger Oberholtzer wrote:
On Thu, 2011-04-28 at 16:39 +0200, Anders Johansson wrote:
On Thursday 28 April 2011 16:36:50 Roger Oberholtzer wrote:
would require "11.2" for a match. Anything after the 2 is irrelevant, but the '2' must be present. Could this trailing '*' be the source of the problem, and not just an unnecessary spec for the rest of the string after the chars marched in the previous part of the rule?
Your string was 11\.2* and this matches 11. followed by absolutely anything at all. This is why it matched on 11.3.
You need either 11\.2 or 11\.2.* - note the extra dot before the asterisk
I think this was the issue. 11\.2.* is what I needed. Not 11\.2*
In another post I claimed I probably had the wrong usage throughout my rules file but was lucky. That seems not to be the case. The usage was correct. When I added the set of rules for messages from OBS, I messed up. Seems I forgot something I once knew. Again...
Thanks for the help!
It is a regexp, not a glob. In regexp speak the "11\.2*" would match: 11. 11.2 11.22 11.222 .. 11.2222222222222222222222222222222222222222... Ciao, Marcus -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Roger Oberholtzer
I think this was the issue. 11\.2.* is what I needed. Not 11\.2*
No, what you needed was: 11\.2 with nothing following. according to "man procmailrc": \. matches a single dot 11\.2 matches 11.2 plus ANYTHING or NOTHING following everything following a regular expression is automagically matched. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, 2011-04-28 at 09:18 -0400, Patrick Shanahan wrote:
Matching *anything* trailing the specified recipie is the default in procmail, ie: the regex to match trailing information is superfulous. * ^Subject:.*openSUSE_11\.2 and * ^Subject:.*opensuse_11\.2* will match the same lines. Promail is not case sensitive unless the recipie is flagged as such and the matching regex does not consider anything following the regex.
In fact, with the strings I am looking at, I think I could use: * ^Subject:.*openSUSE_11\.2 or: * ^Subject:.*openSUSE_11.2 as the character between the '11' and the '2' does not differentiate any strings. I wanted to make the intended meaning of the rule more complete, so I require a period. I doubt this is the cause of the problem (famous last words). Time till tell. I just wait for OBS activity to send messages my way... Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 28 April 2011 16:31:47 Dimstar / Dominique Leuenberger wrote:
On Thu, 2011-04-28 at 14:55 +0200, Roger Oberholtzer wrote:
* ^From:.*hermes@opensuse\.org * ^Subject:.*openSUSE_11\.2*
Shouldn't there be a dot before the 2? I'm not sure if procmail uses regular expressions, but if it does that means "0 or more instances of '2'" and would match openSUSE_11. regardless of what follows, no?
Hmm. I was expecting the \. to be an escaped period. Meaning that a literal period is needed to make a match. The period in the rule string should have no special regexp meaning and be satisfied only by a literal period at that place in the test string. Did I get this wrong?
Anders actually meant to have a . AFTER the 2, not before.
Ah, yes, "slight" typo there. Thanks for correcting it :) Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (7)
-
Anders Johansson
-
Carlos E. R.
-
Dimstar / Dominique Leuenberger
-
Marcus Meissner
-
Patrick Shanahan
-
Roger Oberholtzer
-
Stefan Gofferje