Questions tagged [procmail]

Procmail (http://procmail.org/) is a powerful Mail Delivery Agent (MDA) capable of sorting and filtering mail based on rulesets called recipes. It's rather *nix-centric, terse, mature, and proven. However, it is now unmaintained.

Procmail is a versatile mail delivery agent (MDA) for Unix-like systems. If features a simple language for articulating delivery rules (aka recipes) to sort, forward, manipulate, and otherwise process incoming email messages.

Procmail was created in the early 1990s by Stephen R. van den Berg. After his involvement waned, Philip Guenther took over as maintainer, and published some new versions at http://procmail.org/. However, this site is now dead, and as of 2010, Guenther recommends users to switch to alternative tools such as maildrop.

In spite of its age and security issues, Procmail remains popular in some environments.

Resources

(Copied from Stack Overflow's procmail tag info page.)

77 questions
8
votes
2 answers

How can I test a procmail rule without sending myself an email?

I am getting a lot of spam messages from a certain country. They all have the same pattern in the source. I want to write a procmail rule to automatically move all those emails to my Spam folder. The source of a spam email might look like this…
RommelTJ
  • 183
2
votes
1 answer

Advanced procmail recipe

I need to write a procmail rule or rules that's a bit beyond the basics. I have Bacula installed and I want all mail where the subject begins with Bacula: Backup OK for to be moved into a folder named backups -- these are good backups so I don't…
JFlo
  • 151
1
vote
0 answers

Can procmail intercept incoming messages to a mailing list and modify it before letting it be delivered to the mailboxes of the members of the ML?

I have an email address (a mailing list actually) with a basic procmail setup enabled. Right now, the procmail just dumps incoming emails to fs. I have a use-case where I want to add a custom string to be prepended to each email's body which is…
1
vote
1 answer

Procmail: Send ticket numbers to an address named "ticket@domain"?

I am looking to do the following: User sends an email to 1234@domain Procmail recognizes 1234@domain as an email sent to ticket+1234@domain Procmail recipe handles ticket number and forwards email to the bug tracker Where bold is my current…
1
vote
1 answer

Procmail deleting body

I have a procmail recipe which sends the body of a mail to a script. Works well but procmail then sends the mail without the body to my default folder. :0 * ^Subject.*Telemetry rotate$ { :0 bf ! `/usr/bin/php -f /path/to/script/script.php` } How…
Danny
  • 175
1
vote
1 answer

What is the scope of the special case `FLAG ??` override in procmail?

man procmailrc says: variablename ?? Match the remainder of this condition against the value of this environment variable (which cannot be a pseudo variable). A special case is if variablename is equal to B, H, HB or BH; this merely overrides the…
dg99
  • 2,642
1
vote
1 answer

Procmail: find email sent from and to the same address?

Is there a way with procmail (or something else?) to search for email where the from: and to: fields both contain the same address? And can it be done without needing to hardcode each and every email address in a recipe? Basically I'm trying to find…
0
votes
1 answer

procmail recipe assistance

I know just enough about regexp to make my brain hurt and I was hoping for some assistance. I need a recipe to take any mail that doesn't have the string "ZYX" in the TO: line and dump it into "0.waste". Would someone be willing to lend a hand?
0
votes
1 answer

Procmail error when piping body to php script

I have a procmail recipe that takes the body of a mail and sends it to a php script. However, procmail complains with an error. Here is how it works: The user that needs access to hardware parameters has to register via e-mail like…
Danny
  • 175
0
votes
2 answers

procmailrc and php

This doesn't work. It's supposed to email me.(as a test; what we really want the php file to do is insert into a mySQL database table) The input is a payment notification message from PayPal. (A similar recipe does find the Description line and…