cornerhost wiki   FAQ/spam UserPreferences
 
HelpContents FindPage Diffs Info Edit Subscribe XML Print View

  1. Dealing with SPAM
    1. Set your catch-all email rules to bounce
    2. Install Spam Assassin
  2. Simple Procmail spamtrap

Dealing with SPAM

How to fight spam on your cornerhost account:

  1. Set your catch-all email rule to bounce
  2. Install spamassassin

Set your catch-all email rules to bounce

By default, mail for any name at your domain goes into your account mailbox. This makes it easy to set mail up, but also means that spammers have more ways to reach you.

For example, say your domain is example.com and you want to only accept mail sent to these two addresses:

Do this:

  1. Log into the control panel (http://cornerhost.net/)
  2. From the navigation links, under email, select edit rules

For each address:

  1. Select add rule for your domain (eg, example.com)
  2. Select a rule; for example: "Mail for fred@example.com should: go into your cornerhost mailbox"
  3. Save rule

Next, turn off mail to all other names at example.com: from the same email configuration page:

  1. Select "your_username" next to the domain
  2. Select this rule: "By default, mail for example.com should: bounce with a "no such user" error"
  3. Save

Install Spam Assassin

Create a text file called .procmailrc and upload it to your home directory. Your home directory is where your FTP client will take you by default when you log in to the server.

To enable Spam Assassin for email only or secondary email accounts, use the username and password for that account when you FTP.

The file should contain these two lines:

:0fw
| spamc

This will mark suspected spam with a header that says "Spam-Status: Yes". You can then set your email reader (user agent) to filter such mails.

If you use IMAP for your mail (or a shell client such as pine), you can add these three lines to automatically move spam to another mailbox (which you must first create!):

:0:
* ^X-Spam-Status: Yes
mail/Spam

Create this Spam mailbox using the SquirrelMail Web-mail interface:

  1. From http://cornerhost.net/ go to SquirrelMail (new)
  2. In section Folders, enter "Spam" (case sensitive?) in the Create folder form
  3. Select Create

This creates the mailbox in your home directory: ~/mail/Spam.

IMPORTANT: Make sure you upload in ASCII mode (if you edited it on Winblows) and that only you can write to your .procmailrc file (ie, set its permissions to 0600).

There are all kinds of options for configuring spamassassin. I find whitelist_from and blacklist_from especially useful.

For more information:

Simple Procmail spamtrap

Due to 2 typical actions of spammers, you can filter out much of their email.

  1. They harvest addresses right from the code of your website
  2. They usually sort their lists of email addresses by domain name and send one email to each domain, with all the individual addresses in the 'to' field

If you hide a fake address in the code for your website, it will eventually be picked up by spammers and included in the list of addresses at your domain. If you just block that address, the other copies will get through. But you can use procmail to block any message that includes that address in the 'to' field, not just where it is the main address.

Create a file called .procmailrc in your home directory and add the following lines:

:0:
* ^TOspamtrap
/dev/null

In this example, replace 'spamtrap' with the userid portion of your fake address.

Although you can do this with any address, make sure you won't receive ANY real email at that address. This should only be done if you have your own domain.

IMPORTANT: Make sure you upload in ASCII mode (if you edited it on Winblows) and that only you can write to your .procmailrc file (ie, set its permissions to 0600).

PythonPowered