Tips from The Answer Guy
I need to refuse to accept e-mail from a particular person. How can I configure Netscape and/or CND1.0 to bounce the person's mail back to them? —Mitch, Mobile, Alabama
I'd use procmail, a little programming language written specifically for processing mail. CND uses procmail as the “local delivery agent” by default. This means that sendmail passes any mail for a local account to procmail, and then lets procmail do the final delivery to your mail box, /var/spool/mail/your_login_name. At the same time, procmail checks for a .procmailrc file in your home directory, and does some ownership and permissions checks on it for you.
The author of a .procmailrc file can specify a variety of settings and clauses which are called “recipes”, and can also modularize the file by using a variety of INCLUDE directives. Here's a simple example that should get you started:
:0 hr
* ^From.*spammer.you.despise@spamhaven.com
* !^FROM_MAILER
* !^FROM_DAEMON
* !^X-Loop: ${USERNAME}i@`hostname`"
| (formail -r -A"X-Loop:
${USERNAME}@`hostname`" \
-A"Precedence: junk";\
echo "Your mail is not welcome here."\
echo "Please don't mail me again."\
echo\
cat ~/your.signature.or.flame
)
The :0 marks this as a new recipe—each new recipe starts with this line. The h and the r on that line are flags tell procmail which parts of the message to hand to your action line (i.e., the one that starts with a pipe, |).
h says: “Give me the header.”
r says: “Treat the incoming data as raw.”
The r flag is given to prevent your response from failing if the sender has failed to put a blank line at the end of his message.
The following four “star” lines in the script are conditions. The first specifies that the header will show that the message is “from” your spammer, that is, your unwanted sender. This address will exactly match any “from” or “From:” line that contains your target e-mail address. The next two lines of the script ensure that you don't respond to daemons and mailers (mailing lists). The last * line, which you should fill in with your user name and host name, ensures that your don't respond to your own response. Those three conditions are included to protect your script from being tricked into undesirable actions. Consider them to be the minimum overhead on any auto-responders that you write.
The next line of the script, which starts with a “|” pipe character, describes the action to take. In procmail there are three types of actions:
A file name specifies an mbox (elm, pine or mailx compatible) folder in which to store the message.
A directory name specifies an mh or mmdf folder for mail storage. mh and mmdf use different naming schemes for the messages in their folder directories, but you don't need to worry about this difference unless you use one of their mail user agents.
A ! (bang) line specifies an e-mail address to which the message is to be bounced. A | (pipe) line specifies that the message is to be filtered through a local program.
formail is a program that comes with the procmail package. It “formats mail headers”. This particular formail command formats a “reply” (-r) header, and adds two additional header lines—a standard “Precedence: junk” line and a personal “X-” line. The RFC822 spec allows you to use the X- line to embed custom information into a header. It is also in the formail command line that you prevent an attack by routing your response back into your own script, i.e., a mail loop.
The echo and cat statements after the formail line provide output that is appended after the mail header and that becomes the body of your response. You can add additional echo lines or you can create a file and use cat to add it here.
If you are new to procmail (which is almost certain given your question—auto-responders are some of the first things that procmail users learn), you may be nervous about breaking something and losing some of your mail. To protect yourself you will want to start your .procmailrc with the following simple recipe:
:0 c fallback
This recipe, if it is the first recipe in the script, appends a copy of every incoming message to a file named fallback in your ~/Mail directory by default. You can compare the contents of that folder to your inbox until you are confident that everything is working as you expect.
Please read the procmail and procmailex (examples) man pages for more details. The author, Stephen van der Berg, has also written an automated mail list management package called SmartList that is highly regarded among people that I know who have used it. I like SmartList much better than Majordomo. —Jim
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- RSS Feeds
- Readers' Choice Awards
- Tech Tip: Really Simple HTTP Server with Python
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




1 hour 56 min ago
2 hours 28 min ago
4 hours 52 min ago
4 hours 55 min ago
4 hours 56 min ago
9 hours 21 min ago
11 hours 12 min ago
16 hours 26 min ago
19 hours 37 min ago
21 hours 52 min ago