Difference between revisions of "SpamAssassin"
(Created page with 'SpamAssassin is a program installed on our virtual web servers that filters your email for spam based on a pre-defined scoring system. We provide this service free of charge to o…') |
|||
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{1 prefix}} | ||
SpamAssassin is a program installed on our virtual web servers that filters your email for spam based on a pre-defined scoring system. We provide this service free of charge to our customers. It requires a small procmail configuration inside your account space. | SpamAssassin is a program installed on our virtual web servers that filters your email for spam based on a pre-defined scoring system. We provide this service free of charge to our customers. It requires a small procmail configuration inside your account space. | ||
== Instructions == | == Instructions == | ||
− | What you'll need: | + | === What you'll need: === |
* a text editor, such as Notepad (Windows) or TextEdit (Mac). Important: make sure the editor is set to Plain Text mode and not Rich Text mode. | * a text editor, such as Notepad (Windows) or TextEdit (Mac). Important: make sure the editor is set to Plain Text mode and not Rich Text mode. | ||
* an FTP or SFTP client, such as [[Internet Software|WinSCP]] (Windows) or [[Internet Software|Cyberduck]] (Mac), the same one you used when uploading your website. Note: if you had a third party upload your website, ask them to perform this entire task for you instead. | * an FTP or SFTP client, such as [[Internet Software|WinSCP]] (Windows) or [[Internet Software|Cyberduck]] (Mac), the same one you used when uploading your website. Note: if you had a third party upload your website, ask them to perform this entire task for you instead. | ||
− | Here are instructions for | + | === Activation Walkthrough === |
+ | Here are the instructions for installing SpamAssassin in your account: | ||
* Open your text editor. | * Open your text editor. | ||
* Apply the right ruleset: | * Apply the right ruleset: | ||
− | :If you're on one of our newer servers, copy the following and paste it into your editor window: | + | :If you're on one of our newer v3 servers, copy the following and paste it into your editor window: |
<pre> | <pre> | ||
:0fw | :0fw | ||
Line 25: | Line 27: | ||
:0: | :0: | ||
* ^X-Spam-Status: Yes | * ^X-Spam-Status: Yes | ||
− | $DEFAULT/. | + | $DEFAULT/.Junk/ |
</pre> | </pre> | ||
− | :If you're on one of our older servers, copy the following and paste it into your editor window | + | :If you're on one of our older v1 or v2 servers, copy the following and paste it into your editor window. Note that this results in emails identified as spam being deleted outright. Placing spam emails in a Junk folder is a feature supported only on our version 3 servers. |
<pre> | <pre> | ||
:0fw | :0fw | ||
Line 44: | Line 46: | ||
:'''Note:''' if you're unsure whether or not you're on an older or newer server, please contact support. | :'''Note:''' if you're unsure whether or not you're on an older or newer server, please contact support. | ||
* Save the file as: procmail.txt | * Save the file as: procmail.txt | ||
− | * Connect to your webhosting server via SFTP. | + | * Connect to your webhosting server via [[Uploading_&_Downloading_Files | SFTP]]. |
* Upload the procmail.txt file, and make sure that you use ASCII format when you do so. | * Upload the procmail.txt file, and make sure that you use ASCII format when you do so. | ||
* Once the file is uploaded, rename the file: .procmailrc (note the preceding period; this is very important) | * Once the file is uploaded, rename the file: .procmailrc (note the preceding period; this is very important) | ||
− | * You're done! Spamassassin is now installed and will work instantly and automatically for all email accounts. | + | |
+ | If you already have a file named .procmailrc (e.g. for email forwarding), instead of creating a new file, edit the existing one and put the above examples into it, below the general settings but before any of the other recipes. You want to remove spam before forwarding! | ||
+ | |||
+ | ==== Deleting super-spam (optional) (v3 only) ==== | ||
+ | |||
+ | Some spam is spammier than other spam. Spamassassin knows this and scores appropriately. Anything under a default score of 5 is sent to your Inbox. Anything 5 or above is sent to the Spam folder. This is good for catching false positives, but digging through piles of 15s or 20s can be tiresome. | ||
+ | |||
+ | It's possible to delete this high scoring "super-spam" while keeping the lower scoring spam. Here is a full ruleset that deletes 12s and above: | ||
+ | |||
+ | <pre> | ||
+ | :0fw | ||
+ | * < 60000 | ||
+ | | /usr/bin/spamc | ||
+ | |||
+ | :0e | ||
+ | { | ||
+ | EXITCODE=77 | ||
+ | } | ||
+ | |||
+ | :0 | ||
+ | * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\* | ||
+ | /dev/null | ||
+ | |||
+ | :0: | ||
+ | * ^X-Spam-Status: Yes | ||
+ | $DEFAULT/.Junk/ | ||
+ | </pre> | ||
+ | |||
+ | Note the <tt>* ^X-Spam-Level:</tt> addition. Every <tt>\*</tt> is one point of Spam score you're automatically deleting. More asterisks, more saved spam. Fewer asterisks, more automatically deleted spam. | ||
+ | |||
+ | === You're done! === | ||
+ | |||
+ | Spamassassin is now installed and will work instantly and automatically for all email accounts. | ||
+ | |||
+ | == Whitelisting/Blacklisting == | ||
+ | You can also use SpamAssassin to automatically flag email from some addresses or domains as spam, or always let it through regardless of how spammy it is. To do this, connect to your account using SFTP or SSH and change to the ".spamassassin" directory. You may need to configure your SFTP client to show hidden files for it to show up. In that directory, edit the file named "user_prefs". To add addresses or domains to your whitelist or blacklist, add lines similar to the following and save the file: | ||
+ | <pre>whitelist_auth *@he.net | ||
+ | blacklist_from bob@iselljunk.com</pre> | ||
+ | |||
+ | You can read the comments in user_prefs for other options you can change by editing it. | ||
== Troubleshooting == | == Troubleshooting == | ||
Line 59: | Line 100: | ||
----- | ----- | ||
</pre> | </pre> | ||
− | For detailed information about SpamAssassin, please visit [ | + | For detailed information about SpamAssassin, please visit [https://spamassassin.apache.org/ spamassassin.apache.org]. |
+ | |||
+ | Please note that options listed in the SpamAssassin documentation as "privileged," such as custom rule definitions, are not available. | ||
+ | [[Category:Webhosting]] |
Latest revision as of 09:49, 24 August 2015
This information only pertains to Hurricane Electric's Shared Web Hosting package. There may be different information in our other categories.
SpamAssassin is a program installed on our virtual web servers that filters your email for spam based on a pre-defined scoring system. We provide this service free of charge to our customers. It requires a small procmail configuration inside your account space.
Contents
Instructions
What you'll need:
- a text editor, such as Notepad (Windows) or TextEdit (Mac). Important: make sure the editor is set to Plain Text mode and not Rich Text mode.
- an FTP or SFTP client, such as WinSCP (Windows) or Cyberduck (Mac), the same one you used when uploading your website. Note: if you had a third party upload your website, ask them to perform this entire task for you instead.
Activation Walkthrough
Here are the instructions for installing SpamAssassin in your account:
- Open your text editor.
- Apply the right ruleset:
- If you're on one of our newer v3 servers, copy the following and paste it into your editor window:
:0fw * < 60000 | /usr/bin/spamc :0e { EXITCODE=77 } :0: * ^X-Spam-Status: Yes $DEFAULT/.Junk/
- If you're on one of our older v1 or v2 servers, copy the following and paste it into your editor window. Note that this results in emails identified as spam being deleted outright. Placing spam emails in a Junk folder is a feature supported only on our version 3 servers.
:0fw * < 60000 | /usr/bin/spamassassin :0e { EXITCODE=77 } :0: * ^X-Spam-Status: Yes /dev/null
- Note: if you're unsure whether or not you're on an older or newer server, please contact support.
- Save the file as: procmail.txt
- Connect to your webhosting server via SFTP.
- Upload the procmail.txt file, and make sure that you use ASCII format when you do so.
- Once the file is uploaded, rename the file: .procmailrc (note the preceding period; this is very important)
If you already have a file named .procmailrc (e.g. for email forwarding), instead of creating a new file, edit the existing one and put the above examples into it, below the general settings but before any of the other recipes. You want to remove spam before forwarding!
Deleting super-spam (optional) (v3 only)
Some spam is spammier than other spam. Spamassassin knows this and scores appropriately. Anything under a default score of 5 is sent to your Inbox. Anything 5 or above is sent to the Spam folder. This is good for catching false positives, but digging through piles of 15s or 20s can be tiresome.
It's possible to delete this high scoring "super-spam" while keeping the lower scoring spam. Here is a full ruleset that deletes 12s and above:
:0fw * < 60000 | /usr/bin/spamc :0e { EXITCODE=77 } :0 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\* /dev/null :0: * ^X-Spam-Status: Yes $DEFAULT/.Junk/
Note the * ^X-Spam-Level: addition. Every \* is one point of Spam score you're automatically deleting. More asterisks, more saved spam. Fewer asterisks, more automatically deleted spam.
You're done!
Spamassassin is now installed and will work instantly and automatically for all email accounts.
Whitelisting/Blacklisting
You can also use SpamAssassin to automatically flag email from some addresses or domains as spam, or always let it through regardless of how spammy it is. To do this, connect to your account using SFTP or SSH and change to the ".spamassassin" directory. You may need to configure your SFTP client to show hidden files for it to show up. In that directory, edit the file named "user_prefs". To add addresses or domains to your whitelist or blacklist, add lines similar to the following and save the file:
whitelist_auth *@he.net blacklist_from bob@iselljunk.com
You can read the comments in user_prefs for other options you can change by editing it.
Troubleshooting
If you've set a procmail.log file within your .procmailrc, you can examine that file for originating email addresses, subjects, file size, and times of the spam receipt:
----- From terry7567793414v13@spamhub.com.au Thu Jul 11 00:13:15 2002 Subject: *****SPAM***** Here is that link 1594HNsC1--9 Folder: /dev/null 4748 -----
For detailed information about SpamAssassin, please visit spamassassin.apache.org.
Please note that options listed in the SpamAssassin documentation as "privileged," such as custom rule definitions, are not available.