Discussion:
[PLUG] Sorting mail with procmail recipe
Rich Shepard
2018-10-24 15:47:40 UTC
Permalink
One mail list to which I am subscribed is no longer obeying the recipe in
~/procmail/recipes.rc. It's probably a regex error and I'd like to learn why
so I can fix it.

The current recipe is:
:0:
* ^(From|Cc|To).*lists.osgeo.org
spatial-analyses

A recent message in my INBOX rather than that file is addressed this way:

To: grass-***@lists.osgeo.org

The former recipe had this form:

:0:
* ^TO_.*@lists.osgeo.org
spatial-analyses

which works for To: and Cc: on other mail lists (and used to work for the
osgeo.org maillists, too.

Your thoughts welcomed.

Rich
Paul Heinlein
2018-10-24 15:58:53 UTC
Permalink
Post by Rich Shepard
One mail list to which I am subscribed is no longer obeying the recipe in
~/procmail/recipes.rc. It's probably a regex error and I'd like to learn why
so I can fix it.
* ^(From|Cc|To).*lists.osgeo.org
spatial-analyses
Rich,

Does the list provide a List-Id header? That's usually the one I use,
e.g.,

# mailing lists
:0
* ^List-Id:.*<(plug|plug-talk)\.pdxlinux\.org>
.mailinglists.plug/
--
Paul Heinlein
***@madboa.com
45°38' N, 122°6' W
Rich Shepard
2018-10-24 16:36:20 UTC
Permalink
Post by Paul Heinlein
Does the list provide a List-Id header? That's usually the one I use,
e.g.,
# mailing lists
:0
* ^List-Id:.*<(plug|plug-talk)\.pdxlinux\.org>
.mailinglists.plug/
Paul,

Yes. In this case the grass-***@lists.osgeo.org. I tried that preceeded
by ^(From|Cc|To) as well as the above address and both failed.

I was unaware of the List-Id: label, even after reading the man and web
pages. I'll try that now.

Thanks,

Rich
Paul Heinlein
2018-10-24 17:07:20 UTC
Permalink
Post by Rich Shepard
Post by Paul Heinlein
Does the list provide a List-Id header? That's usually the one I use,
e.g.,
# mailing lists
: 0
* ^List-Id:.*<(plug|plug-talk)\.pdxlinux\.org>
.mailinglists.plug/
Paul,
by ^(From|Cc|To) as well as the above address and both failed.
I was unaware of the List-Id: label, even after reading the man and web
pages. I'll try that now.
There's nothing special about the List-Id header; it's just something
that Mailman inserts into outbound messages. Perhaps other list
managers use it as well.

Open a list message in Alpine and press the H key to see the full
headers. You should be able to spot that header if it's there. If not,
the osgeo.org list server may have another header that procmail can
spot.
--
Paul Heinlein
***@madboa.com
45°38' N, 122°6' W
Rich Shepard
2018-10-24 17:16:15 UTC
Permalink
There's nothing special about the List-Id header; it's just something that
Mailman inserts into outbound messages. Perhaps other list managers use it
as well.
Open a list message in Alpine and press the H key to see the full headers.
You should be able to spot that header if it's there. If not, the osgeo.org
list server may have another header that procmail can spot.
Paul,

Yep, it's there all right.

I was thinking of using the subject line tag associated with that list:
Subject: [GRASS-user]
because I was not familiar with all recipe options for procmail.

Thanks again,

Rich
Paul Heinlein
2018-10-24 17:25:49 UTC
Permalink
Post by Rich Shepard
There's nothing special about the List-Id header; it's just something that
Mailman inserts into outbound messages. Perhaps other list managers use it
as well.
Open a list message in Alpine and press the H key to see the full headers.
You should be able to spot that header if it's there. If not, the
osgeo.org list server may have another header that procmail can spot.
Paul,
Yep, it's there all right.
Subject: [GRASS-user]
because I was not familiar with all recipe options for procmail.
All procmail does is run a case-insensitive egrep regular expression
against your inbound messages. By default, the regex is run only
against the mail headers, though procmail recipes can grep the message
body as well if you'd like.

The reason I like grep-ing the List-Id header is that, for instance,
personal replies to list messages will end up in my inbox rather than
in the list folder.

If you choose to match the Subject: header, make sure your rule is
flexible enough to match reply (re:, Re:, etc) strings prior to the
group name. See, for instance, the Subject: header in this message.
--
Paul Heinlein
***@madboa.com
45°38' N, 122°6' W
Rich Shepard
2018-10-24 17:34:15 UTC
Permalink
By default, the regex is run only against the mail headers, though
procmail recipes can grep the message body as well if you'd like.
Paul,

I didn't know this.
The reason I like grep-ing the List-Id header is that, for instance,
personal replies to list messages will end up in my inbox rather than in
the list folder.
Good point; I'll change all recipes to use List-Id.

Often response messages sent to 'all' end up in my inbox as well as the
mail list, but those sent to me don't appear on the latter.
If you choose to match the Subject: header, make sure your rule is
flexible enough to match reply (re:, Re:, etc) strings prior to the group
name. See, for instance, the Subject: header in this message.
Meh. The current recipes for most mail lists work OK. Why this one list
changed its behavior I've no idea, except that it's sent via osgeo.org
rather than grass.org.

Thanks for the insights,

Rich
Rich Shepard
2018-11-01 17:23:56 UTC
Permalink
Post by Paul Heinlein
All procmail does is run a case-insensitive egrep regular expression
against your inbound messages. By default, the regex is run only against
the mail headers, though procmail recipes can grep the message body as
well if you'd like.
If you choose to match the Subject: header, make sure your rule is
flexible enough to match reply (re:, Re:, etc) strings prior to the group
name. See, for instance, the Subject: header in this message.
Paul,

What is working is using only the subject line tag for the mail list
preceeded by a '*'.

Regards,

Rich

Loading...