I finally figured out how to do this. The only downside is that there is no way for the user to easily manage their config file in the control panel (plugin is on the way, hopefully -- once I get some time).
Basically, this will allow each *nix user to maintain their own SA config file, instead of being forced to use the sitewide file.
Step 1: Install SpamAssassin
We need to install SpamAssassin before we can do anything. You can do so by executing these commands:
Step 2: Setup a startup script
The ideal way to do this would be via an init script. However, I just used a little shell script for the time being until I have the time to write an init script up. To follow what I did:
then paste in the following:
next, you need to chmod the file. I did this as root, and will only ever execute this as root. so I did:
Step 3: Start Spam Assassin
Now we can start SA by issuing the following command:
Step 4: Configuring Exim
I highly recommend you install jlasman's SpamBlocker as outlined here
Whether you do or don't is up to you. The next step you must do is uncomment the following two sections in /etc/exim.conf (note, I already uncommented mine, you will see below what your sections should look like after you uncomment them):
If you were observant, you will notice my second section differs slightly from yours!
Notice the line:
You should change your transport_filter line to resemble that above.
Now save your changes and restart exim!
Notes
- The default SA config file is located at /etc/mail/spamassassin/local.cf
- User config files will be located at /home/<username>/.spamassassin/user_prefs
- the user config file MUST be created by you (for now). to do so you may issue the following commands, replacing <username> with the actual user's username
- You can find user preference options here
I hope this helps some of you looking to enable per-user SA config files
Basically, this will allow each *nix user to maintain their own SA config file, instead of being forced to use the sitewide file.
Step 1: Install SpamAssassin
We need to install SpamAssassin before we can do anything. You can do so by executing these commands:
Code:
cd /usr/local/directadmin/scripts
./spam.sh
Step 2: Setup a startup script
The ideal way to do this would be via an init script. However, I just used a little shell script for the time being until I have the time to write an init script up. To follow what I did:
Code:
pico /usr/local/sbin/spamd
Code:
killall spamd
/usr/bin/spamd -d -c -u mail
next, you need to chmod the file. I did this as root, and will only ever execute this as root. so I did:
Code:
chmod 700 /usr/local/sbin/spamd
Step 3: Start Spam Assassin
Now we can start SA by issuing the following command:
Code:
/usr/local/sbin/spamd
Step 4: Configuring Exim
I highly recommend you install jlasman's SpamBlocker as outlined here
Whether you do or don't is up to you. The next step you must do is uncomment the following two sections in /etc/exim.conf (note, I already uncommented mine, you will see below what your sections should look like after you uncomment them):
Code:
# Spam Assassin
spamcheck_director:
driver = accept
condition = "${if and { {!def:h_X-Spam-Flag:} {!eq {$received_protocol}{spam-scanned}} {!eq {$received_protocol}{local}} } {1}{0}}"
retry_use_local_part
transport = spamcheck
no_verify
Code:
# Spam Assassin
begin transports
spamcheck:
driver = pipe
batch_max = 100
command = /usr/sbin/exim -oMr spam-scanned -bS
current_directory = "/tmp"
group = mail
home_directory = "/tmp"
log_output
message_prefix =
message_suffix =
return_fail_output
no_return_path_add
transport_filter = /usr/bin/spamc -u ${lookup{$domain}lsearch{/etc/virtual/domainowners}}
use_bsmtp
user = mail
# must use a privileged user to set $received_protocol on the way back in!
If you were observant, you will notice my second section differs slightly from yours!
Notice the line:
Code:
transport_filter = /usr/bin/spamc -u ${lookup{$domain}lsearch{/etc/virtual/domainowners}}
Now save your changes and restart exim!
Notes
- The default SA config file is located at /etc/mail/spamassassin/local.cf
- User config files will be located at /home/<username>/.spamassassin/user_prefs
- the user config file MUST be created by you (for now). to do so you may issue the following commands, replacing <username> with the actual user's username
Code:
cd /home/<username>
mkdir .spamassassin
cp /usr/share/spamassassin/user_prefs.template ./.spamassassin/user_prefs
chown -R <username>.mail ./spamassassin
chmod 770 ./.spamassassin/user_prefs
- You can find user preference options here
I hope this helps some of you looking to enable per-user SA config files