Performing multiple actions with procmail

Red Squirrel

No Lifer
May 24, 2003
69,807
13,379
126
www.anyf.ca
How do I make it so that when procmail rule matches, that more then one thing happends?

In a particular rule, I want the mail to get forwarded to an address, but I also want it to be copied to a folder. So how can I do that?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Read the procmailex man page, there's an example of exactly what you want to do right at the top. Hooray for documentation.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Forward all mail from peter about compilers to william (and keep a copy of it here in petcompil).

:0
* ^From.*peter
* ^Subject:.*compilers
{
:0 c
! william@somewhere.edu

:0
petcompil

}

An equivalent solution that accomplishes the same:


:0 c
* ^From.*peter
* ^Subject:.*compilers
! william@somewhere.edu

:0 A
petcompil

An equivalent, but slightly slower solution that accomplishes the same:

:0 c
* ^From.*peter
* ^Subject:.*compilers
! william@somewhere.edu

:0
* ^From.*peter
* ^Subject:.*compilers
petcompil

Linked to in your man page.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0

No, that's the procmail man page, I said the procmailex man page. It's the one containing procmail examples.

I don't see where it says how. Most of the reasearch I did says it's not possible to do more then one action on one piece of mail, but I'm just hoping it's not the case, but if it is then I'll have to find an alternative.

I'd like to know where you're doing your research because the docs that come with procmail say otherwise.
 

Red Squirrel

No Lifer
May 24, 2003
69,807
13,379
126
www.anyf.ca
Turns out that when I created the folder in squirrelmail it made the first letter capital, so it was dumping the mail in the folder that's not capitalized (it created it). Seems to be working now. My next project is to make the "fail" part send a bounce, but I don't think I can do that with procmail but I'll have to check and see.

The really need to update their documentation though to make it more userfriendly, like really, it was writen when I was 10 lol.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
So you're 14? That probably explains why you never want to actually read documentation.
 

Red Squirrel

No Lifer
May 24, 2003
69,807
13,379
126
www.anyf.ca
No I'm 19, but that documentation was written in 1996, and I was born in 1986. Probably one of the oldest documents of the internet LOL, given the internet only existed for 1 year before that point. Also noticable by the plainish html, and I wonder if the procmail site is that old too... and the program.... maildrop seems nice, but switching would be a large task to deploy as I'd have to rewrite my whole mail routing system, but at least maildrop has a decent syntax. So I'm thinking of it, but not sure yet, I think I'm best to just try and get everything working with procmail, once it's done it's done.