Here’s a handy script that will generate a .qmail and a .procmailrc file for each mailbox on the entire server. You can place this script anywhere you want and run this as a higher authority such as root.

The .qmail file that is produced will send all mail to procmail in order to move spam mail into junk folders. Another interesting line in the .qmail file is the following: