Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
2answers
34 views

procmailrc-Killfile for recipient addresses?

I want to block mails with certain recipient addresses using procmailrc (temporary addresses that now only receive spam). I found a code sample for using a killfile/blacklist, but it only applies to ...
1
vote
1answer
30 views

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 ! `/...
0
votes
1answer
97 views

Postfix not accepting mail from procmail in Centos7?

I have a Centos 7 server setup with Postfix, Spamassassin and procmail. It works fine, it receives and sends email , it passes it to the spam filter and delivers it to the required user or external ...
0
votes
0answers
168 views

Procmail Couldn't create or rename temp file, not receiving mails

I cant receive any mail from outside, here all my settings and outputs: More informations are in the Procmail output, all the permissions is for the user and I dont see anything wrong here... Im ...
2
votes
2answers
1k views

procmail save attachment with received date in filename

Every day we receive an e-mail from e.g. foo@example.tld with an attachment, the filename is e.g. report.xlsx How can I save the file with the received date? e.g. 20180131_report.xlsx and how can I ...
0
votes
2answers
186 views

Making a Procmail regex recipe for malicious email body text

At work we recently began receiving emails with what looks like malicious code contained in the email body. I'm trying to create a procmail recipe that will use regex to match only the non-word ...
1
vote
1answer
24 views

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 ...
1
vote
1answer
726 views

Forward/Redirect email fetched via fetchmail to gmail

I am on a mac using terminal. I am trying to redirect email from a work email to gmail (the work email only allows IMAP and gmail can only fetch from POP - hence the workaround). I have successfully ...
0
votes
2answers
1k views

Using procmail to forward to gmail

I am using fetchmail and procmail to forward email to a gmail account. I am using Mac Terminal. Here is my .fetchmailrc: set no bouncemail poll outlook.office365.com with protocol imap port 993 auth ...
0
votes
2answers
176 views

postfix + procmail — process serially, not in parallel

Trying to design a system that can filter incoming email messages from a syslog server. Need to drop if they appear to be duplicates (throttle them). Procmail pipes them to a perl script for ...
1
vote
2answers
300 views

Processing/sorting mail from a mailbox-file?

I got a mailbox-file ("Mboxrd") created by getmail, and I'd like to "process" it by sorting mail from various (groups of) senders, and move them to separate mailbox-files (I guess 3-5 for now). ...
1
vote
2answers
586 views

How do you use procmail mda to deliver files to be read by mh?

I'm using fetchmail to download email, and using procmail for delivery as the mda. I'd like them to be delivered for use with mh, but procmail seems to deliver them in a manner that mh doesn't ...
3
votes
1answer
327 views

Procmail does not continue processing untill recipe is finished

Related question reference here Below is my procmail recipe which works fantastic ... :0bf * ^Subject.*register$ | /usr/bin/php -f /root/data/scripts/register.php However, the recipe/script above ...
0
votes
1answer
257 views

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 ...
1
vote
1answer
290 views

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 ...
3
votes
1answer
167 views

Why is procmail hanging?

I have a goofy sendmail aliases.local file set up to pass emails to procmail. This is a set up that was working on ancient Solaris systems. Now I am running it on a RHEL6 system: # cat /etc/redhat-...
5
votes
2answers
3k views

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:.*root@example.com.* * ^Subject:.*fixed string in the subject line.* * .*fixed string in the ...
1
vote
1answer
451 views

Produce bounce message when Sendmail fails

I'm trying to receive a bounce mail message when an outgoing message cannot reach smtp external server (due to my local internet connection problems). I send emails using: mutt (compose) - procmail - ...
0
votes
2answers
162 views

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 ...
0
votes
3answers
2k views

How to stop Procmail?

I had an instance that procmail has been running and taking up RAM. I am not using this. Is it possible to stop / uninstall this? I am running CentOS 6.4. Thank you!
3
votes
1answer
4k views

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 ...
2
votes
0answers
60 views

how to prevent procmail listening to the world [closed]

This is part of a larger effort to try and ensure my server is not infected and spamming the internet with spam emails I had a friend take a look at the server and he said "Your procmail is open to ...
1
vote
2answers
36 views

Procmail to recognize e-mails which were already copied into a folder

I am working at a place where e-mails are sent to multiple groups very often, which means that e-mails will be filtered into random directories, even in mid-thread if a new group is added to the ...
0
votes
1answer
1k views

Auto-Reply to Messages Sent to Mailing List

Background and Current Situation I inherited a CentOS 5.7 box running Mailman 2.1.9 housing a series of legacy mailing lists. I've been working on moving these lists to other services like Exchange ...
2
votes
2answers
491 views

Procmail not running

I'm using: Mutt-kz + Isync + msmtp + spamassassin + Procmail Mutt-kz, Isync and msmtp are working. I cannot make procmail start automatically when mail arrives. I'm doing everything as non-root user ...
2
votes
1answer
68 views

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 ...
1
vote
0answers
45 views

procmail and libnotify: how to display emails received? [duplicate]

I am trying to get procmail to work with libnotify (notify-send). My .procmailrc has a couple of recipes, which just essentially filter mails into different folders.. nothing fancy. Most of my ...
2
votes
2answers
1k views

How to split existing mailboxes based on date with procmail

I have huge mailboxes I would like to manage based on the age of their content: backup, archival or removal. I would like to split these mailboxes along the date of their contained messages. For a ...
4
votes
2answers
832 views

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 ...
2
votes
1answer
1k views

Procmail - auto reply with attachment

I am trying to auto-reply using procmail. I want to send back an HTML form with attachments (images; jpg/png). Is there a simple way to accomplish this? This is my piece of code so far: :0 | ($...
0
votes
2answers
346 views

Checking if a mail has arrived, if not then alert

I am using fetchmail in combination with procmail for mail filtering on CentOS where my mail contains various log messages. They serve me so I could search through my mail(logs) for error strings. So ...
2
votes
1answer
187 views

I WANT procmail to delay one user's e-mail 10 seconds then continue processing

I use procmail. I wrote my own spam filter in procmail (along with many many recipes). I know this is sounds counter-intuitive but I want to intentionally delay one user's e-Mail about 5 or 10 ...
-3
votes
1answer
159 views

Fetchmail doesn't recognize my procmail binary

My problem: after running fetchmail I get this error: /Users/User/.fetchmailrc:7: syntax error at -d My .fetchmailrc file looks like this: set daemon 300 set nobouncemail set invisible poll pop....
2
votes
1answer
2k views

Problem extracting email attachment using munpack

I have fetchmail running perfectly to fetch emails from Gmail, and then I am using procmail to store them in $HOME/Mail/Inbox. In my .procmailrc, I added this code which pipes to munpack to extract ...
1
vote
1answer
12k views

Mail filtering with procmail in a postfix/dovecot system with virtual users

I had a postfix/dovecot system with mail users working. After unsuccessfully following a few tutorials online to enable procmail, now I have an unusable system. What I want is to enable procmail ...
2
votes
2answers
7k views

procmail save into a dir and execute a script?

I'm using procmail with Maildir/ and easy rules like the one below to save incoming emails into directories: :0: * ^X-Spam-Status: Yes Spam/ Now I would like a desktop notification on new emails in ...
5
votes
3answers
868 views

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 ...
0
votes
1answer
337 views

Job started by procmail does not appear in ps-output and cannot be stopped, even not after reboot

For testing purposes I called procmail by my .forward file |/usr/bin/procmail and by the rules in .procmailrc it started a job named "start", which was simply an infinite loop while true do ...
4
votes
2answers
478 views

How to debug ~/.forward

How can I debug ~/.forward file or see errors logged by mail agent on it without root privileges? I'm trying to process my mail with procmail. When I invoke procmail manually with procmail < ...
1
vote
1answer
134 views

Selectively forward email based on domain?

I have an alias on my mail server, call it splitusers. Based on which domain (a couple are run off one mail server) is used, I would like the mail forwarded to a different user account. Eg: ...
2
votes
1answer
1k views

Use /etc/init.d/fetchmail with the personnal ~/.fetchmailrc

Now, I have two users in my system using fetchmail with a personal ~/.fetchmailrc and syncing there mails with the command fetchmail -kv --uidl -m '\''/usr/bin/procmail -d %T'\ (In a cron but this isn’...
2
votes
2answers
1k views

procmail recipe with a regex doesn't work

In my ~/.procmailrc I have the following lines: :0 \* ^Subject:.*(O|o)pen( \|)(S|s)(onic|urge) $MAILDIR/OpenSurge/ As you see, I would like to put any mail containing “Open Surge” (or any variant ...
1
vote
1answer
3k views

What's the safest way to pipe an email to a script via procmail?

I have a simple procmailrc recipe that hands mail off to a script: LOGFILE=/home/foouser/procmail-log VERBOSE=yes MAILDIR=/var/spool/mail/foouser DEFAULT=/var/spool/mail/foouser SHELL=/bin/sh ...
3
votes
2answers
751 views

Why does procmail send a copy of an inbound message to sender if it encounters an exit code?

I have a very simple procmail process that takes an inbound email and redirects it to a script: LOGFILE=/home/foo/procmail-log VERBOSE=yes MAILDIR=/var/spool/mail/foo DEFAULT=/var/spool/mail/foo ...
2
votes
0answers
476 views

filter cron emails through procmail?

I'm using postfix/mutt/procmail on a Linux/Debian and I've some trouble filtering cron emails with procmail, I just want to move them to the cron/ maildir directory, but no lucky till now. I've ...
0
votes
1answer
596 views

Processing multiple mails in a Postfix mailbox by making cronjob run per second-is that considered good practice?

I need to process at least three thousand incoming emails an hour that are received in a postfix mailbox. Processing involves extracting email attachments and sending the content of an email ...
6
votes
2answers
3k views

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 ...
2
votes
2answers
1k views

How can I use procmail to modify the body of an email and then forward it to an external address?

I'm struggling to get procmail to first transform, and then forward, a received email. Here's what I'd like to do: :0 f | ~/bin/encryptemail.pl | mail foobar@gmail.com That is, I want to run the ...
2
votes
1answer
296 views

Procmail standard base path for directory delivery

I had trouble with procmail not wanting to deliver my mail to a specific folder. I had: DEFAULT=/home/vmail/${ER_DOMAIN}/${ER_USER}/ :0 * ^To:.*my-email * ^Subject:.*some-filter .the-dir/ But got ...
4
votes
1answer
1k views

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