Questions tagged [procmail]

Procmail 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

172 questions
0
votes
1 answer

Any way to filter email dynamically by taking 'from' and matching it with database ? (Using procmail or Virtualmin or Webmin)

I basically want to check the incoming 'From' in the email received and then either Keep it and make it deliver to the intended mailbox if the email matches a Specified MySQL/PostgreSQL Database User (eg. select email from users where exists…
gb.123
  • 1
  • 2
0
votes
1 answer

Procmail recipe to match Spamassassin X-Spam-Status score or X-Spam-Level

Consider these mail headers: X-Spam-Level: *** X-Spam-Status: Yes, score=3.7 required=3.0 tests= (remaining truncated for brevity) I simply want to match the headers "X-Spam-Level: ***" (at least with more "*" okay) or "X-Spam-Status: Yes,…
Montclair
  • 81
  • 1
  • 10
0
votes
1 answer

Procmail/munpack: Extracting headers similar to text and attachments?

I currently have set up fetchmail to transfer mail to procmail and a .procmailrc file with the following content: FILE_DIR=$HOME/incoming :0 * | munpack -q -C "$FILE_DIR" If I receive emails with attachments, munpack will create a file123.ext and…
SoWhy
  • 143
  • 1
  • 1
  • 6
0
votes
1 answer

Procmail content as POST variable

Procmail should send my emails with the content to my api. No matter what I try, I get the subject etc., but I can't get to the content. The $CONTENT variable is filled with the subject. :0 { :0 w | CONTENT= cat :0 | URL=$(curl -d …
FutureMode
  • 113
  • 1
  • 8
0
votes
1 answer

procmail: conditioning on multiple fields

I would like to store e-mails sent by me to others using the "From" field to a folder called "/sent" So, I use: :0: *^From.*user@outlook.com $HOME/Mail/sent/. And it used to work fine. However, now I am also forwarding my e-mail from the…
user3236841
  • 1,088
  • 1
  • 15
  • 39
0
votes
1 answer

Having permissions issues with procmail and python script

So here is my procmalirc. The script seems to run as the "user" of the mailbox so the script CANT create locks or flush or remove messages because the procmail seems to have a lock on the mailbox. SHELL = /bin/sh LOGFILE = $HOME/pm.log LOGABSTRACT =…
BostonMacOSX
  • 1,369
  • 2
  • 17
  • 38
0
votes
1 answer

How to delete IMAP mail with fetchmail / procmail

I use fetchmail with imap protocol to upload emails from a mail server, and pipe them in procmail. I do this with the following command: fetchmail -f /home/$USER/.fetchmailrc --ssl -t 100 -d 240 -s -m "/usr/bin/procmail /home/$USER/.procmailrc "…
0
votes
1 answer

Procmail Replace / Add Subject to an Empty Subject Field

I have a recipe that cannot seem to match the address. I tried these: * ^From.*address9\@gmail\.com * ^From.*address9@gmail.com * ^From.*address\[0-9\]\@gmail\.com * ^From.*address\d\@gmail\.com * ^From.*address\d@gmail.com but none of the…
Dennis
  • 1
  • 4
0
votes
1 answer

Problem with Unicode in Python as a procmail filter

I'm running into issues when trying to process mail with procmail and Python. I am using syntax something like this: :0 ...[Filter] | (python3 script.py) >> file.txt as procmail syntax. My Python script extracts the mail from stdin, converts MIME…
Carl Philipp
  • 181
  • 1
  • 10
0
votes
0 answers

Procmail external command is called multiple times

I've a debian (9.6) system with standard mbox mailing over postfix (2.9.6-2). My ~/.procmailrc is very simple: LOGFILE=/tmp/procmailoggy LOGABSTRACT=yes VERBOSE=yes :0c | /home/user/import_email.sh and my ~/.forward file: "|IFS=' ' && exec…
user2194805
  • 1,201
  • 1
  • 17
  • 35
0
votes
1 answer

Pass Postfix' queue id to procmail

Is there any way to pass the postfix' queue id (not the Message-ID: header) to a procmail command? The reason behind is to have a procmail logfile containing the queue id for detailed logging about a handled message.
Schubi Duah
  • 309
  • 1
  • 7
0
votes
1 answer

How to receive all emails pertaining to a domain, on my production machine?

I have a strange requirement, any website user(not linux system user) will be getting a email id, say jack@mywebsite.com,sarah@mywebsite.com with which they are going to have a inbox feature built into their dashboard. Any outside user(can be anyone…
Nanda Kishore
  • 2,789
  • 5
  • 38
  • 61
0
votes
1 answer

How do I alter email headers using procmail?

We use JIRA Cloud for our ticketing system, which does not support using email aliases. Since we now have two domains in our system, with the second domain added as an alias in G Suite (same usernames across both). Management decided to use this new…
0
votes
1 answer

Using .forward to preprocess incoming email?

I have no previous experience with procmail. I have written a filter to repair broken headers in certain emails that I receive. I need to set up my .forward file to run the repair filter without breaking the existing email processing. Let's say…
Peter L.
  • 63
  • 4
0
votes
1 answer

Automatic procmail filter based on username

I use postfix and procmail for mail and folder filtering. I have a main address and a bunch of alias addresses that go to it, then I sort the username to a folder that matches. For example I have the main address of 'address@domain.com" and a alias…
Jeremy
  • 47
  • 5