Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Imagination is more important than knowledge. -- Albert Einstein


devel / comp.unix.shell / Re: procmailrc

SubjectAuthor
* procmailrcme at
+* procmailrcLew Pitcher
|`* procmailrcLew Pitcher
| `* procmailrcLew Pitcher
|  `- procmailrcme at
`* procmailrcKenny McCormack
 `* procmailrcLew Pitcher
  `- procmailrcEli the Bearded

1
procmailrc

<tje5s0$mrn$1@reader2.panix.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6765&group=comp.unix.shell#6765

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.208.201.242.22!not-for-mail
From: my.address@is.invalid (me at)
Newsgroups: comp.unix.shell
Subject: procmailrc
Date: Thu, 27 Oct 2022 14:50:40 -0000 (UTC)
Organization: which
Message-ID: <tje5s0$mrn$1@reader2.panix.com>
Injection-Date: Thu, 27 Oct 2022 14:50:40 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="208.201.242.22";
logging-data="23415"; mail-complaints-to="abuse@panix.com"
User-Agent: tin/2.4.1-20161224 ("Daill") (UNIX) (Linux/3.10.0-1160.76.1.el7.x86_64 (x86_64))
X-No-Archive: Yes
 by: me at - Thu, 27 Oct 2022 14:50 UTC

Good morning,

In my .procmailrc will this work to both append the email to an existing file
and also forward the email?

:0c
* ^subject:.*jacket.*puffy
$HOME/trash/forwarded
! person@domain.com

Thanks,

Re: procmailrc

<tje7db$2p2no$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6766&group=comp.unix.shell#6766

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Thu, 27 Oct 2022 15:16:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <tje7db$2p2no$1@dont-email.me>
References: <tje5s0$mrn$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 27 Oct 2022 15:16:59 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f6789e85a27e5bf3d1c4dfbfa9b7b9b4";
logging-data="2919160"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/L+j1TDShitIzSlQcZVgqfRyLbfDwINro="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:f4zKJAVcM4S7Y1XnX7T6Hxkxy5U=
 by: Lew Pitcher - Thu, 27 Oct 2022 15:16 UTC

On Thu, 27 Oct 2022 14:50:40 +0000, me at wrote:

> Good morning,
>
> In my .procmailrc will this work to both append the email to an existing file
> and also forward the email?
>
> :0c
> * ^subject:.*jacket.*puffy
> $HOME/trash/forwarded
> ! person@domain.com

I haven't played with procmail recipes in a long time, so I may be wrong, but
I don't think that the above recipe will work.

According to procmailrc(5) ("man 5 procmailrc"), a procmail recipe consists of
- a single flags line,
- zero or more conditions, and
- exactly one action line

While your recipe satisfies the "single flag line" and "zero or more condition
line", it fails as you have more than one action line.

Since your recipe makes a carbon copy for delivery, procmail will execute the
recipe, and then pass the original email along to the next matching recipe.

So, you /should/ be able to accomplish your goal with two recipes. Something
like

:0c
* ^subject:.*jacket.*puffy
$HOME/trash/forwarded

:0c
* ^subject:.*jacket.*puffy
! person@domain.com

> Thanks,

For what it's worth, you can find some assistance both in the manual pages
and online. For procmail, I've depended on procmailrc(5), which explains
the format of the procmailrc, and procmailex(5), which provides some
examples. Additionally, I've used, and recommend, "Timo's procmail tips and
recipes", a web page at
http://www.abreau.net/howto/procmail/procmailrc-tips.html

HTH
--
Lew Pitcher
"In Skills, We Trust"

Re: procmailrc

<tje7g7$39gtq$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6767&group=comp.unix.shell#6767

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Thu, 27 Oct 2022 15:18:31 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <tje7g7$39gtq$1@news.xmission.com>
References: <tje5s0$mrn$1@reader2.panix.com>
Injection-Date: Thu, 27 Oct 2022 15:18:31 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3457978"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 27 Oct 2022 15:18 UTC

In article <tje5s0$mrn$1@reader2.panix.com>,
me at <my.address@is.invalid> wrote:
>
> Good morning,
>
>In my .procmailrc will this work to both append the email to an existing file
>and also forward the email?
>
> :0c
> * ^subject:.*jacket.*puffy
> $HOME/trash/forwarded
> ! person@domain.com

Speaking as a long time user of procmail - and one who has gotten
acclimated to its many quirks - I can say that the only way to know the
answer to your question is to test it and see. procmail is just plain
buggy in some respects, and you just have to learn to live with this.

I've read somewhere that the code has become unmaintainable, so whatever
bugs are there will remain there for eternity.

(Despite the above two paragraphs, I still use it and see no reasons to try
anything else)

Two general thoughts:
1) My general instinct would be to have two rules for the two actions.
I.e., use the same filter on each - one to do the first thing and
one to do the second.
2) The truly safe way to do this sort of thing is to have a single
action that pipes the mail to a shell script. Then, in the script,
you can do whatever you want.

--
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."

- Greta Thunberg -

Re: procmailrc

<tje8ik$2p2no$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6768&group=comp.unix.shell#6768

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Thu, 27 Oct 2022 15:36:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <tje8ik$2p2no$2@dont-email.me>
References: <tje5s0$mrn$1@reader2.panix.com> <tje7db$2p2no$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 27 Oct 2022 15:36:52 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f6789e85a27e5bf3d1c4dfbfa9b7b9b4";
logging-data="2919160"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e1k5CW3z4X+lVwtp43oVusvBrTv/fyf0="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:TeoUgDhFZ0CKiHTvmNOuJV07ZfI=
 by: Lew Pitcher - Thu, 27 Oct 2022 15:36 UTC

On Thu, 27 Oct 2022 15:16:59 +0000, Lew Pitcher wrote:

> On Thu, 27 Oct 2022 14:50:40 +0000, me at wrote:
>
>> Good morning,
>>
>> In my .procmailrc will this work to both append the email to an existing file
>> and also forward the email?
>>
>> :0c
>> * ^subject:.*jacket.*puffy
>> $HOME/trash/forwarded
>> ! person@domain.com
>
> I haven't played with procmail recipes in a long time, so I may be wrong, but
> I don't think that the above recipe will work.
>
> According to procmailrc(5) ("man 5 procmailrc"), a procmail recipe consists of
> - a single flags line,
> - zero or more conditions, and
> - exactly one action line
>
> While your recipe satisfies the "single flag line" and "zero or more condition
> line", it fails as you have more than one action line.
>
> Since your recipe makes a carbon copy for delivery, procmail will execute the
> recipe, and then pass the original email along to the next matching recipe.
>
> So, you /should/ be able to accomplish your goal with two recipes. Something
> like
>
> :0c
> * ^subject:.*jacket.*puffy
> $HOME/trash/forwarded
>
> :0c
> * ^subject:.*jacket.*puffy
> ! person@domain.com
>

For what it's worth, you can also accomplish this as a recipe with sub-recipes.
As in
:0c
* ^subject:.*jacket.*puffy
{
:0
$HOME/trash/forwarded

:0
! person@domain.com
}

This makes a carbon copy of the original email, and passes it on
to two sub-recipes, each which deliver the cc in their own way.

[snip]

--
Lew Pitcher
"In Skills, We Trust"

Re: procmailrc

<tje95c$2p2no$3@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6769&group=comp.unix.shell#6769

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Thu, 27 Oct 2022 15:46:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <tje95c$2p2no$3@dont-email.me>
References: <tje5s0$mrn$1@reader2.panix.com> <tje7db$2p2no$1@dont-email.me>
<tje8ik$2p2no$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 27 Oct 2022 15:46:53 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f6789e85a27e5bf3d1c4dfbfa9b7b9b4";
logging-data="2919160"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fKA6MDXbmZBNB1N1lwmLRReqEMzdiyAU="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:arLoBgee1RNN5jfkqN5FcNmf7Sg=
 by: Lew Pitcher - Thu, 27 Oct 2022 15:46 UTC

On Thu, 27 Oct 2022 15:36:52 +0000, Lew Pitcher wrote:

> On Thu, 27 Oct 2022 15:16:59 +0000, Lew Pitcher wrote:
>
>> On Thu, 27 Oct 2022 14:50:40 +0000, me at wrote:
>>
>>> Good morning,
>>>
>>> In my .procmailrc will this work to both append the email to an existing file
>>> and also forward the email?
>>>
>>> :0c
>>> * ^subject:.*jacket.*puffy
>>> $HOME/trash/forwarded
>>> ! person@domain.com
>>
>> I haven't played with procmail recipes in a long time, so I may be wrong, but
>> I don't think that the above recipe will work.
>>
>> According to procmailrc(5) ("man 5 procmailrc"), a procmail recipe consists of
>> - a single flags line,
>> - zero or more conditions, and
>> - exactly one action line
>>
>> While your recipe satisfies the "single flag line" and "zero or more condition
>> line", it fails as you have more than one action line.
>>
>> Since your recipe makes a carbon copy for delivery, procmail will execute the
>> recipe, and then pass the original email along to the next matching recipe.
>>
>> So, you /should/ be able to accomplish your goal with two recipes. Something
>> like
>>
>> :0c
>> * ^subject:.*jacket.*puffy
>> $HOME/trash/forwarded
>>
>> :0c
>> * ^subject:.*jacket.*puffy
>> ! person@domain.com
>>
>
> For what it's worth, you can also accomplish this as a recipe with sub-recipes.

Make that

:0c
* ^subject:.*jacket.*puffy
{
:0c
$HOME/trash/forwarded

:0
! person@domain.com
}

The first sub-recipe needs to pass a carbon copy on to the second sub-recipe,
otherwise the second sub-recipe won't get any mail at all.

Also, as Kenny suggested, the best way to determine if your recipes work is
to test them with procmail. I vaguely recollect being able to test at the
commandline by feeding test emails into procmail's stdin.

HTH
--
Lew Pitcher
"In Skills, We Trust"

Re: procmailrc

<tjeh4u$2p2no$4@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6770&group=comp.unix.shell#6770

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Thu, 27 Oct 2022 18:03:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tjeh4u$2p2no$4@dont-email.me>
References: <tje5s0$mrn$1@reader2.panix.com>
<tje7g7$39gtq$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 27 Oct 2022 18:03:10 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f6789e85a27e5bf3d1c4dfbfa9b7b9b4";
logging-data="2919160"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+A6uALbeSXXO6hsm1wRSCQalIiBTb/Pj8="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:Ijl8BmbUHgLlNtywQGRIDmj2Du4=
 by: Lew Pitcher - Thu, 27 Oct 2022 18:03 UTC

On Thu, 27 Oct 2022 15:18:31 +0000, Kenny McCormack wrote:
[snip]

> Speaking as a long time user of procmail - and one who has gotten
> acclimated to its many quirks - I can say that the only way to know the
> answer to your question is to test it and see. procmail is just plain
> buggy in some respects, and you just have to learn to live with this.
>
> I've read somewhere that the code has become unmaintainable, so whatever
> bugs are there will remain there for eternity.

Apparently, while procmail development went dormant for over a decade, it
has restarted. In May 2020, Stephen R. van den Berg resumed development of
procmail and released v3.24 in Februry 2022.

You can find the current source code at https://github.com/BuGlessRB/procmail

[snip]
--
Lew Pitcher
"In Skills, We Trust"

Re: procmailrc

<eli$2210271741@qaz.wtf>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6771&group=comp.unix.shell#6771

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix5.panix.com!qz!not-for-mail
From: *@eli.users.panix.com (Eli the Bearded)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Thu, 27 Oct 2022 21:44:52 -0000 (UTC)
Organization: Some absurd concept
Message-ID: <eli$2210271741@qaz.wtf>
References: <tje5s0$mrn$1@reader2.panix.com> <tje7g7$39gtq$1@news.xmission.com> <tjeh4u$2p2no$4@dont-email.me>
Injection-Date: Thu, 27 Oct 2022 21:44:52 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix5.panix.com:166.84.1.5";
logging-data="13018"; mail-complaints-to="abuse@panix.com"
User-Agent: Vectrex rn 2.1 (beta)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
XFrom: is a real address
Encrypted: double rot-13
 by: Eli the Bearded - Thu, 27 Oct 2022 21:44 UTC

In comp.unix.shell, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
> Kenny McCormack wrote:
>> Speaking as a long time user of procmail - and one who has gotten
>> acclimated to its many quirks - I can say that the only way to know the
>> answer to your question is to test it and see. procmail is just plain
>> buggy in some respects, and you just have to learn to live with this.

I find that is very rarely the case. The documentation is very poor in
some places,and the syntax is a nightmare, but buggy to the point of try
it and see only, no.

>> I've read somewhere that the code has become unmaintainable, so whatever
>> bugs are there will remain there for eternity.

The code is a nightmare to work with, eschewing every standard syntax
style, C with minimal white space, few comments, repeated use of
`goto`s, many functions that work on substring plus length instead of C
strings. I asked around in comp.lang.c if anyone knew a pretty printer
that could cope with it and got no good responses.

Here's a short sample function:

struct field**addfield(pointer,text,totlen)struct field**pointer;
const char*const text;const size_t totlen; /* add field to a linked list */
{ register struct field*p,**pp;int idlen;
for(pp=pointer;*pp;pp= &(*pp)->fld_next); /* skip to the end of the list */
(*pp=p=malloc(FLD_HEADSIZ+totlen))->fld_next=0;idlen=breakfield(text,totlen);
p->id_len=idlen>0?idlen:pp==&rdheader?0:-idlen; /* copy contents */
tmemmove(p->fld_text,text,p->Tot_len=totlen);
return pp;
}

With some effort I made the procmail helper tool formail able to decode
MIME-encoded words in headers, but never got that working in procmail
proper:

https://github.com/Eli-the-Bearded/procmail-formail

> Apparently, while procmail development went dormant for over a decade,
> it has restarted. In May 2020, Stephen R. van den Berg resumed
> development of procmail and released v3.24 in Februry 2022.

Huh, I did not know that.

> You can find the current source code at
> https://github.com/BuGlessRB/procmail

Snorted at tag "Two decades of fixes". I see that warrants a version
number bump from 3.22 to 3.24.

Elijah
------
has been using procmail well over two decades

Re: procmailrc

<tjglfq$sk5$1@reader2.panix.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6772&group=comp.unix.shell#6772

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.208.201.242.22!not-for-mail
From: my.address@is.invalid (me at)
Newsgroups: comp.unix.shell
Subject: Re: procmailrc
Date: Fri, 28 Oct 2022 13:29:30 -0000 (UTC)
Organization: which
Message-ID: <tjglfq$sk5$1@reader2.panix.com>
References: <tje5s0$mrn$1@reader2.panix.com> <tje7db$2p2no$1@dont-email.me> <tje8ik$2p2no$2@dont-email.me> <tje95c$2p2no$3@dont-email.me>
Injection-Date: Fri, 28 Oct 2022 13:29:30 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="208.201.242.22";
logging-data="29317"; mail-complaints-to="abuse@panix.com"
User-Agent: tin/2.4.1-20161224 ("Daill") (UNIX) (Linux/3.10.0-1160.76.1.el7.x86_64 (x86_64))
X-No-Archive: Yes
 by: me at - Fri, 28 Oct 2022 13:29 UTC

Thu, 27 Oct 2022 08:46:53 Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
|
| :0c
| * ^subject:.*jacket.*puffy
| {
| :0c
| $HOME/trash/forwarded
|
| :0
| ! person@domain.com
| }
|

This worked great. Put it in yesterday and it just processed the first candidate.

Thank you,

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor