Blocking Unwanted Email
Blocking Unwanted Email

Are you getting lots of annoying email from a particular person, or are you having problems with getting junk email from a bunch of users from the same domain? Would you like a way to block incoming email from a particular person or even an entire domain? There is an easy way to do this, and it involves the use of a .block file.

Setting it up

To block unwanted email from ever being delivered to you, create a .block file in your home directory. If you create this file on your local computer and upload it using ftp, it will go into the / directory. If you edit it while connected to your account via telnet, it will go into your home directory. For example, if your username is francis, it will go into /home/francis, and will appear as:

/home/francis/.block

The .block file has the following syntax:

email address or domain or message content|file or action or email address

Email Address - The email address is a specific email address that you want to block. If you accidentally subscribed to a mailing list and they won't unsubscribe you, put the email address of the mailing list here, and you won't receive any further mail from them. Make sure that you put their email address exactly as it is shown in the "X-From" field of email you receive from them. This is their actual email address, regardless of what the "From" field says.

Domain - If you get a lot of email from a specific domain, and you know you never get legitimate email from them, block the entire domain by putting it into your .block file. Again, make sure that you put their domain name exactly as it appears in the "X-From" field. For example, if mail is coming from the domain nojoke.jokesters.com, putting jokesters.com in your .block file won't work. You need to use the entire domain name of nojoke.jokesters.com.

Message Content - Be careful with this one, as you might end up blocking legitimate email. But if you get lots of email with "Make Money Fast" or "See My Private Videos", either in the subject line or the body of the message, you can block them from ever appearing in you mail box. Just put the phrase you want to look for in your .block file, and if that phrase shows up anywhere in the incoming email message, it goes to the bit bucket.

Although contents of the .block file are not case-sensitive, it's a good idea to make all entries lower-case. Lower-case letters are easier to read, and you're bound to make fewer mistakes by using them.

Here is an example .block file:

make money fast|/dev/null
[email protected]|/dev/null
spammers.org|/dev/null
evildoers.com|/dev/null
spamcity.net|/dev/null
homeplate.net|/home/francis/txt/leavemealone.txt
[email protected]|/home/francis/txt/nomorejokes.txt
[email protected]|[email protected], [email protected]

In the first five lines of the above example, all email ends up in /dev/null. This is another term for "bit bucket" or trash. The mail simply disappears, and you never have to look at it.

In the next two lines, the mail still disappears, but a specific message is sent to the offending person or domain to let them know what you think about them. The message can say anything. For example, here is the text of the leavemealone.txt file:

From: [email protected]
Subject: your offensive email

Please climb out of whatever hole is cursed by your presence long enough
to take me off of whatever list you have me on. I hope to never receive
any more trash from you. May your troubles be as great as the number of
email messages I have received from you.

Have a nice day!

In the final line, all email that was sent from sistersue will be redirected to brotherbob and goofyjoe, who since they don't mind sending you tons of email, might appreciate receiving some that you don't want.

That's it. You can now run interference on all those pesky emails you didn't know what to do with.


Go back to the Virtual Site Administration Page