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.)

74 questions
10
votes
2 answers

How to stop Fetchmail marking messages as read

When fetchmail checks my IMAP inbox, it downloads any unread messages and removes the message 'unread' flag on the mail server. Is there a way to have fetchmail download new messages without marking them as read? I use procmail to automatically…
Steve HHH
  • 683
  • 7
  • 12
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
  • 5
8
votes
4 answers

How can I apply my procmail filters to my maildir inbox?

Last night I subscribed to a mailing list, and discovered this morning that my procmail filter didn't apply to many of the mailing list messages. Now I have loads of less-important mailing list messages interspersed with my more-important work…
Cory Klein
  • 18,391
  • 26
  • 81
  • 93
8
votes
3 answers

Receive Pop/IMAP email and then forward as encrypted to gmail

Basically, I have an email account I can access as POP3 or IMAP. I want to take all incoming emails, encrypt them, and then forward the encrypted version to my gmail account (so I can see the subject/notifications on my phone/gmail account; and…
dr jimbob
  • 370
  • 3
  • 11
7
votes
3 answers

Restricting who can send to an email address

I'd like to do so that only certain From: addresses can send to an email address (mailing list) on an Ubuntu system running Postfix. Understanding the Postfix the manuals are requires a lot of knowledge, so I'm hoping to get a complete recipe I can…
forthrin
  • 2,209
  • 2
  • 27
  • 46
6
votes
2 answers

Using Munpack to extract attachments of specific file type (Debian/Squeeze)

I configured Munpack on my Debian/Linux to extract attachments from incoming emails. (For additional context, Getmail fetches the emails and pipes it to Procmail. A Procmail recipe then pipes it to Munpack.) | munpack -q -C directory/ For some…
Spartanblogger
  • 587
  • 3
  • 9
  • 16
6
votes
2 answers

How to create Procmail filter that checks both headers and body

I'm trying to create a Procmail rule based on all of From, Subject and a string in the body: :0 B: * ^From:.*[email protected].* * ^Subject:.*fixed string in the subject line.* * .*fixed string in the body.* /dev/null I'm trying to delete a…
fooquency
  • 172
  • 1
  • 8
5
votes
1 answer

Procmail: Denying special privileges for "/etc/procmailrcs/default.rc"

I'm trying to setup postfix, dovecot and procmail to work together with virtual users. In the end I want to have virtual users and the possibility to add rules to sort incoming rules. For the last thing, I need procmail (right?). When I send an…
user37050
5
votes
2 answers

Do procmail recipes have an alternator "or" operator?

Given the following procmail recipe: :0: * ^Subject:.*viagra.* * ^From:.*viagra.* /dev/null Procmail would only delete emails that were both from viagra, and had viagra in the subject. Is it possible to apply the filter if either of the matches…
Cory Klein
  • 18,391
  • 26
  • 81
  • 93
5
votes
2 answers

Forwarding my institute mail to gmail?

I wanted to forward emails which comes to my institute mail to my gmail, while keeping the originals in the institute account too. I tried editing my /.procmail file like below: # Forward everything to me at gmail :0: ! [email protected] This…
dexterdev
  • 345
  • 1
  • 2
  • 7
5
votes
3 answers

How to grab the oldest unread message from `mail` in a script?

In a script I am trying to finish writing now, I need to get the oldest unread message from the current user's mailbox (specifically, I need the subject line for this project). After extracting the oldest message, I also need to forward it to a…
warren
  • 1,778
  • 3
  • 21
  • 38
4
votes
1 answer

Modify an incoming mail from text/plain to text/html

I'm using mutt to process my mail. There is one sender which declares the wrong content type. The mail arrives with Content-Type: multipart/alternative; boundary=--… and has two parts. They are declared as: Content-Type: text/plain;…
qbi
  • 1,369
  • 1
  • 14
  • 32
4
votes
1 answer

Savings emails as individual files using Procmail

I installed Getmail to retrieve emails from another email server and Procmail to filter the incoming emails. (I am running Debian/Squeeze.) The recipe I created has this code: :0: * ^[email protected] Xyz I thought this will make sure…
Spartanblogger
  • 587
  • 3
  • 9
  • 16
4
votes
1 answer

How to use whitespace in procmailrc recipe destination path?

I use Mutt Maildir for storage mails. I created one mailbox like this Stack Exchange/. (whitespace between Stack and Exchange here) procmailrc recipe: :0 * From: .*Stack\ Exchange Stack Exchange/ But upper recipe destination setting failed. after…
stardiviner
  • 191
  • 1
  • 3
  • 12
4
votes
1 answer

how to use procmail as a MDA for postfix? (mailbox_command)

I am trying to setup procmail as a mail delivery agent (MDA) for postfix. I understand that I should use the mailbox_command option in postfix for this, but an internet search revealed contradicting advice on how exactly to do this: Several…
jochen
  • 278
  • 4
  • 9
1
2 3 4 5