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

168 questions
11
votes
2 answers

Decode the utf8 to ISO-8859-1 mail subject to text in .procmailrc file

Set out to write a simple procmail recipie that would forward the mail if it found the text "ABC Store: New Order" in the subject. :0 * ^(To|From).*abc@cdefgh.com * ^Subject:.*ABC Store: New Order* { Unfortunately the subject field in…
MON
  • 129
  • 1
  • 5
10
votes
1 answer

Procmail: Move to folder and mark as read

a simple question: I want to move emails with a certain subject to a folder and mark them as read afterwards. Moving works for me with :0: H * ^Subject:.*(ThisIsMySubject) $HOME/mail/ThisIsMyFolder But how to mark the mails as read?
Martin
  • 307
  • 3
  • 13
10
votes
2 answers

Want procmail to run a custom python script, everytime a new mail shows up

I have a pretty usual requirement with procmail but I am unable to get the results somehow. I have procmailrc file with this content: :0 * ^To.*@myhost | /usr/bin/python /work/scripts/privilege_emails_forward.py Wherein my custom python…
None-da
  • 2,773
  • 5
  • 35
  • 59
9
votes
2 answers

Procmail vs. Maildrop - which to use?

I need to do mail processing where I manipulate the contents of the mail or invoke a script on the receipt of email, supporting a number of email addresses as the access points. In reading through the MDA agents, procmail appears to be the standard…
heckj
  • 6,120
  • 2
  • 31
  • 45
8
votes
1 answer

Using procmail forward emails to another account keeping a copy

I try to use procmail to send copies from all incoming emails to another email account (both of them on the same server, for example email1 and email2 accounts). My .procmailrc is in email1 account: :0c ! email2 As fas as I know this should keep a…
erno666
  • 163
  • 1
  • 1
  • 9
6
votes
4 answers

What's in your .procmailrc

Are there any handy general items you put in your .procmailrc file?
dlamblin
  • 40,676
  • 19
  • 92
  • 127
4
votes
3 answers

What, if any, injection vulnerabilities are there in bash and how can I protect against them?

I have a bash script which I'm kicking off via procmail. Procmail passes in the subject and from field from an email as arguments to the bash script. Since these values are unsanitized in any way, I'm trying to figure out if there are any injection…
gene_wood
  • 1,630
  • 2
  • 24
  • 33
4
votes
1 answer

how to setup the way procmail is logging

right now in the non verbose log procmail is not logging who the recipient is. It is just logging who the sender is, the subject, date and the delivery. From info@essegisistemi.it Tue Apr 15 20:33:19 2014 Subject: ***** SPAM 7.3 ***** Foto …
Max Muster
  • 1,337
  • 2
  • 13
  • 39
3
votes
1 answer

Logging a common email identifier for sendmail and procmail

In the processing of an in-bound email through sendmail and procmail, I am having trouble matching procmail log entries with sendmail's maillog entries. Sendmail posts the queue-id to the log. Is there a method of sendmail adding the mail queue's…
dsbcpas
  • 31
  • 2
3
votes
2 answers

ripmime permissions for attachments

We're using ripmime with Procmail to extract email contents into files. When extracting the email body (the text) ripmime correctly uses the configured procmail UMASK (022) for the files, but when there is an attachment it creates the file for the…
DavidK
  • 162
  • 2
  • 12
2
votes
2 answers

How to preproccess my emails to have links to my attachments

I'm using mutt over ssh as my mail client. This works great, but looking at the attachments (mostly images) is a bit annoying. Now my idea is to parse the email, store the attachments on my server and create an URL for accessing the attachment and…
duedl0r
  • 8,785
  • 3
  • 27
  • 44
2
votes
1 answer

procmailrc rule for "In-Reply-To header matches previously seen Message-ID header"

Trying to figure out how to have a .procmailrc rule that tosses all mail that is in reply to previously seen mail. Using maildir, and would like the rule to cover messages in either cur/ or new/... Should I have the procmailrc parse all the files? …
samurailawngnome
  • 2,905
  • 3
  • 16
  • 16
2
votes
3 answers

Using procmail to call a php script

I am attempting to do some custom email forwarding. #1 I am on a shared server, which is using qmail, and optionally procmail. What I am trying to accomplish is some custom email forwarding of one address, based on a schedule. For example, I have a…
Ben
  • 726
  • 7
  • 21
2
votes
2 answers

How do I categorise non-english email using procmail and command line tools?

I am subscribed to a mail list where some of the messages are non-english which I cannot understand. How do I filter the non-english messages to /dev/null using procmail and/or command line tools? I use procmail to filter my email, so ideally any…
2
votes
2 answers

Does Procmail have a lowercase function, or a similar capability?

I'm using the following (classic) procmail recipe to catch mailing list e-mails and file them into a folder by list name: :0 * ^((List-Id|X-(Mailing-)?List):(.*[<]\/[^>]*)) { LISTID=$MATCH :0 * LISTID ?? ^\/[^@\.]* …
phillipadsmith
  • 364
  • 2
  • 13
1
2 3
11 12