Q. I want to move all mails tagged as spam to "spam" folder. How do I configure procmail to move spam mail to spam folder?
A. If you have Procmail and Spamassassin installed, then you can move mails using Procmail. It is a mail delivery agent (MDA) or mail filter, a program to process incoming emails on a computer, widely used on Unix systems
Configuration: PROCMAIL MOVE SPAM TO SPAM FOLDER
First, open ~/.procmail file (/home/you/.procmail):
$ vi ~/.procmail
Next append the following config code:
# All mail tagged as spam is moved to "spam" folder.
:0:
* ^X-Spam-Status: Yes
spam
Save and close the file.
Now all email tagged as spam will move to "spam" folder.
See also:
- For more information, see Timo's procmail tips and recipes.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 4 comments… read them below or add one }
This didn’t work at all. I’m running:
Debian Etch
Postfix 2.3.8
Spamassassin 3.2.5
Anyone have any ideas?
I HAVE OUTLOOK EXPRESS TO GET MY E-MAILS
I WANT TO PUT SPAM INTO A FOLDER TO DELETE.
CAN ANY ONE HELP
Does anyone know how to setup postifx and procmail when there are no system users, only virtual ones in postfix? I need to be able to filter spam but users are virtual.
Any ideas?
I would like to move spam from my email now , because the messages are not opening