[SLE] SuSE 10.0 with Procmail - some funny happenings with recipes
I'm puzzled! I've configured two filter recipes to sort my SuSE (and other Linux) mailing list messages into two folders but I have an anomaly: my two filters are: * ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)* Messages from [OT], [SLE] and [SM-USERS] lists are files correctly. Messages from [Openswan Users] are trapped by the OT list filter and thus filed incorrectly. I am curious to know why this happens and how to get the Openswan lists filed correctly. Thanks, in advance, John -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
John wrote:
my two filters are:
* ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)*
Messages from [OT], [SLE] and [SM-USERS] lists are files correctly.
Messages from [Openswan Users] are trapped by the OT list filter and thus filed incorrectly.
Your regex ^Subject:.*\[OT* matches a line : beginning with Subject: followed by 0, 1 or more of any character followed by [O, followed by 0, 1 or more of T. /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Per Jessen wrote:
John wrote:
my two filters are:
* ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)*
Messages from [OT], [SLE] and [SM-USERS] lists are files correctly.
Messages from [Openswan Users] are trapped by the OT list filter and thus filed incorrectly.
Your regex ^Subject:.*\[OT* matches a line :
beginning with Subject: followed by 0, 1 or more of any character followed by [O, followed by 0, 1 or more of T.
/Per Jessen, Zürich
So, in effect, trying to catch the [ character of the mailing list handle [OT] with \[ won't work? J -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Tuesday 13 June 2006 16:26, John wrote:
So, in effect, trying to catch the [ character of the mailing list handle [OT] with \[ won't work?
No, it works. Trying to catch the T with T* doesn't Try \[OT.* instead. Note that * doesn't mean the same in a regular expression as it does in a shell. In a shell, * means "one or more characters". In a regular expression it means "zero or more of the preceeding character or group". The . matches any character, so .* matches zero or more characters -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Anders Johansson wrote:
On Tuesday 13 June 2006 16:26, John wrote:
So, in effect, trying to catch the [ character of the mailing list handle [OT] with \[ won't work?
No, it works. Trying to catch the T with T* doesn't
Thanks for adding that Anders.
Note that * doesn't mean the same in a regular expression as it does in a shell. In a shell, * means "one or more characters".
Err, no - the '*' means '0, 1 or more' when used as a wildcard in the shell (at least in bash). try this: touch klop ls -l klop* /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
* Anders Johansson
On Tuesday 13 June 2006 16:26, John wrote:
So, in effect, trying to catch the [ character of the mailing list handle [OT] with \[ won't work?
No, it works. Trying to catch the T with T* doesn't
Try \[OT.*
instead. Note that * doesn't mean the same in a regular expression as it does in a shell. In a shell, * means "one or more characters". In a regular expression it means "zero or more of the preceeding character or group". The . matches any character, so .* matches zero or more characters
Also, it is not necessary to specify anything after the "OT" as procmail will do that itself, \[OT is sufficient Note: I believe that "\[" has special significance in procmail and does not do the regex escape of the char '[', but I am unable to find it in the man files. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
* Patrick Shanahan
Note: I believe that "\[" has special significance in procmail and does not do the regex escape of the char '[', but I am unable to find it in the man files.
On further review, this appears to be inaccurate. Please disregard. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2006-06-13 at 13:45 +0100, John wrote:
my two filters are:
* ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)*
If you want to catch SuSE lists, use - for example, for this list: * ^X-Mailinglist: suse-linux-e Or, with a trick: :0f * ^X-Mailinglist: suse-linux-e | /usr/bin/formail -bfi "Reply-To:suse-linux-e@suse.com" :0 a: $HOME/Mail/lists/suse-linux-e Most properly configured lists will have an internal header of the "X-Mailinglist" type. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFEjsQPtTMYHG2NR9URAiEQAJ4yeASaVablpHVG0asAlFotnyc3MQCfS/UI g5snGdpayg8twaeBokvUPs0= =UIlZ -----END PGP SIGNATURE----- -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2006-06-13 at 13:45 +0100, John wrote:
my two filters are:
* ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)*
If you want to catch SuSE lists, use - for example, for this list:
* ^X-Mailinglist: suse-linux-e
Or, with a trick:
:0f * ^X-Mailinglist: suse-linux-e | /usr/bin/formail -bfi "Reply-To:suse-linux-e@suse.com" :0 a: $HOME/Mail/lists/suse-linux-e
Most properly configured lists will have an internal header of the "X-Mailinglist" type.
- -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76
iD8DBQFEjsQPtTMYHG2NR9URAiEQAJ4yeASaVablpHVG0asAlFotnyc3MQCfS/UI g5snGdpayg8twaeBokvUPs0= =UIlZ -----END PGP SIGNATURE-----
Thanks, Carlos. I missed the X-Mailinglist type in my scant documentation. Can it be combined with the () filter, eg * ^X-Mailinglist: (suse-linux-e|suse-ot) for example? J -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
John wrote:
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2006-06-13 at 13:45 +0100, John wrote:
my two filters are:
* ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)*
If you want to catch SuSE lists, use - for example, for this list:
* ^X-Mailinglist: suse-linux-e
Or, with a trick:
:0f * ^X-Mailinglist: suse-linux-e | /usr/bin/formail -bfi "Reply-To:suse-linux-e@suse.com" :0 a: $HOME/Mail/lists/suse-linux-e
Most properly configured lists will have an internal header of the "X-Mailinglist" type.
- -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76
iD8DBQFEjsQPtTMYHG2NR9URAiEQAJ4yeASaVablpHVG0asAlFotnyc3MQCfS/UI g5snGdpayg8twaeBokvUPs0= =UIlZ -----END PGP SIGNATURE-----
Thanks, Carlos. I missed the X-Mailinglist type in my scant documentation.
Can it be combined with the () filter, eg
* ^X-Mailinglist: (suse-linux-e|suse-ot)
for example?
J
It seems unfortunate that neither Openswan or SM-USER (Squirrelmail) seem to support this type :-( J -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
John wrote:
John wrote:
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2006-06-13 at 13:45 +0100, John wrote:
my two filters are:
* ^Subject:.*\[OT* and * ^Subject:.*\[(SLE|Openswan|SM-USERS)*
If you want to catch SuSE lists, use - for example, for this list:
* ^X-Mailinglist: suse-linux-e
Or, with a trick:
:0f * ^X-Mailinglist: suse-linux-e | /usr/bin/formail -bfi "Reply-To:suse-linux-e@suse.com" :0 a: $HOME/Mail/lists/suse-linux-e
Most properly configured lists will have an internal header of the "X-Mailinglist" type.
- -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76
iD8DBQFEjsQPtTMYHG2NR9URAiEQAJ4yeASaVablpHVG0asAlFotnyc3MQCfS/UI g5snGdpayg8twaeBokvUPs0= =UIlZ -----END PGP SIGNATURE-----
Thanks, Carlos. I missed the X-Mailinglist type in my scant documentation.
Can it be combined with the () filter, eg
* ^X-Mailinglist: (suse-linux-e|suse-ot)
for example?
J
It seems unfortunate that neither Openswan or SM-USER (Squirrelmail) seem to support this type :-(
J
Now that I've looked at the OpenSwan and SquirrelMail headers, can anyone tell me how does the X-BeenThere type compare with X-Mailinglist in this respect? Thanks J -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2006-06-13 at 16:47 +0100, John wrote:
Thanks, Carlos. I missed the X-Mailinglist type in my scant documentation.
Can it be combined with the () filter, eg
* ^X-Mailinglist: (suse-linux-e|suse-ot)
for example?
Why not? I don't use it for that rule, but a rule is just a rule. For example, after sending to a diferent folder each list mail, I put another rule to catch all CCed mail: :0 * ^TO_((suse-linux-s|suse-linux-e|suse-security|suse-programming-e)@suse.com|opensuse@opensuse.org) $HOME/Mail/lists/in_dups and a final one catches direct mail: :0 $HOME/Mail/lists/in_rsto
It seems unfortunate that neither Openswan or SM-USER (Squirrelmail) seem to support this type :-(
Some others use "List-Id". Yahoo, for example, uses "Mailing-List:" and "List-Id:".
Now that I've looked at the OpenSwan and SquirrelMail headers, can anyone tell me how does the X-BeenThere type compare with X-Mailinglist in this respect?
I don't currently use that one. Provided it is a header seen in all mail coming from a particular list, then you can use it, of course. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFEjwwjtTMYHG2NR9URAtGbAJwLk2XxrR1f1OFELb8iRYtHUOlpgQCdGzzO Skswo4E20imuSA5LFlQSj7E= =Yzhk -----END PGP SIGNATURE----- -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2006-06-13 at 16:47 +0100, John wrote:
Thanks, Carlos. I missed the X-Mailinglist type in my scant documentation.
Can it be combined with the () filter, eg
* ^X-Mailinglist: (suse-linux-e|suse-ot)
for example?
Why not? I don't use it for that rule, but a rule is just a rule.
For example, after sending to a diferent folder each list mail, I put another rule to catch all CCed mail:
:0 * ^TO_((suse-linux-s|suse-linux-e|suse-security|suse-programming-e)@suse.com|opensuse@opensuse.org) $HOME/Mail/lists/in_dups
and a final one catches direct mail:
:0 $HOME/Mail/lists/in_rsto
It seems unfortunate that neither Openswan or SM-USER (Squirrelmail) seem to support this type :-(
Some others use "List-Id". Yahoo, for example, uses "Mailing-List:" and "List-Id:".
Now that I've looked at the OpenSwan and SquirrelMail headers, can anyone tell me how does the X-BeenThere type compare with X-Mailinglist in this respect?
I don't currently use that one. Provided it is a header seen in all mail coming from a particular list, then you can use it, of course.
- -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76
iD8DBQFEjwwjtTMYHG2NR9URAtGbAJwLk2XxrR1f1OFELb8iRYtHUOlpgQCdGzzO Skswo4E20imuSA5LFlQSj7E= =Yzhk -----END PGP SIGNATURE-----
Carlos: Many Thanks, you have opened up several possibilities of which I had not previously thought. I am much indebted to you. Best regards J -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (5)
-
Anders Johansson
-
Carlos E. R.
-
John
-
Patrick Shanahan
-
Per Jessen