On Sun, 18 Apr 2010 02:15:52 +0200
Cyril' <[email protected]> wrote:
> Hi all,
>
Hello
[...]
> No more "appliance.txt", sometimes referred...
>
I am attaching you the appliance.txt from DSPAM 3.4.9. I think John removed
that file after 3.4.9 from DSPAM. So if you see a reference to that file in any
How-To then you know that you are reading a old How-To (at least 5 year old
since 3.4.9 has been released 2005-08-08).
[...]
> Thank for any help,
> Cyril'
>
--
Kind Regards from Switzerland,
Stevan Bajić
Configuring DSPAM as a seamless front-end relay using Postfix
This HOWTO explains how to set up DSPAM as a front-end relay, or "appliance".
Using this configuration, you can point your MX records to the DSPAM server and
then have DSPAM pass along any valid email to your mail server. The example
provided also provides personalized training for each user it is protecting,
even if users have multiple email aliases. This allows you to create more than
just a dumb gateway server, but something smart enough to learn each user's
mail. The drawback to this is that you need to account for all addresses
behind your mail server, but you'll find by the end of this exercise that it's
not very difficult to maintain.
When configuring DSPAM as a relay/appliance, it's generally a good idea to set
up DSPAM on its own server. Therefore, we will assume you've got a fresh server
running *NIX with an existing MySQL 4.1+ installation.
Step 1: Configure, compile and install Postfix with MySQL support
To do this, you'll need to init a set of makefiles including the path to your
MySQL includes and libraries...
make -f Makefile.init makefiles \
'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm'
Then simply
make && make install
Step 2: Configure, compile and install DSPAM with daemon + mysql support
You'll need the following options:
MySQL
Virtual Users
Daemon mode
It may also be a good idea to enable:
Preferences extension
Debug
For example:
./configure --with-storage-driver=mysql_drv \
--with-mysql-libraries=/usr/local/mysql/lib \
--with-mysql-includes=/usr/local/mysql/include \
--enable-virtual-users \
--enable-preferences-extension \
--enable-daemon
Step 3: Install DSPAM MySQL Objects (With a twist)
Create the MySQL objects as outlined in the mysql DSPAM doc, but use the
following SQL call to create the virtual uid table. This basically creates a
table without a primary key, which we're going to use to manually create any
aliases we need:
create table dspam_virtual_uids (
uid smallint not null,
username varchar(128) not null
) type=MyISAM;
create unique index id_virtual_uids_01 on dspam_virtual_uids(username);
You can also find this script in src/tools.mysql_drv/virtual_user_aliases.sql
Step 4: Configure DSPAM to receive LMTP and delivery SMTP
We're going to configure postfix to connect to DSPAM via LMTP using a domain
socket. The following configuration properties shoudl be set in dspam.conf:
ServerQueueSize 32
ServerPID /var/run/dspam.pid
ServerMode standard
ServerParameters "--deliver=innocent"
ServerIdent "localhost.localdomain"
ServerDomainSocketPath /tmp/dspam.sock
You'll also want to use the following ParseToHeader parameters:
ParseToHeaders on
ChangeModeOnParse on
ChangeUserOnParse off
This prevents Postfix from needing to use any aliases for retraining. When
users email [email protected], DSPAM will automatically realize that it
needs to retrain the message. I'll explain how to set this up in a bit.
Step 5: Configure Postfix to use DSPAM + virtual UIDs table
The following is a sample configuration that will tell postfix to use DSPAM
as its virtual transport (passing all mail to DSPAM via LMTP) and to use the
dspam_virtual_uids table as its source for mailbox aliases. You can build on
this and add mysql support for virtual_mailbox_domains, but you'll need to
maintain your own database table for that.
virtual_transport = lmtp:unix:/tmp/dspam.sock
virtual_mailbox_domains = mydomain.com
virtual_mailbox_maps = mysql:/etc/postfix/vmailbox.cf
vmailbox.cf should look something like:
user = [mysql username]
password = [mysql password]
dbname = [mysql db]
query = SELECT username FROM dspam_virtual_uids WHERE username='%s'
table = dspam_virtual_uids
host = 127.0.0.1
select_field = username
where_field = username
additiona_conditions =
Step 6: Add a localStore preference for each user
If your users will have aliases, you'll want to specify a common local store
for each user, so that they don't end up with one set of logs+quarantine
for each alias. To do this, you'll first need to allow the localStore
override in dspam.conf:
AllowOverride localStore
Next, set the localStore preference for that user to their uid or some other
unique identifier:
dspam_admin ch pref [email protected] localStore 1
Now, whenever any address pertaining to this user is emailed, information
will be stored in $DSPAM_HOME/data/1
Step 7: Configure user aliases for dspam_virtual_uids
Postfix is now set up to do a lookup in dspam_virtual_uids. It _must_ find a
valid address in this table in order to accept the message. What you'll need
to do now is to create email addresses (and spam addresses) in this table
for each user behind your mail server. You will need to assign any aliases
under the same UID, and you'll also need to create a spam alias in this
table. For example:
UID Username
1 [email protected]
1 [email protected]
1 [email protected] <- An alias
1 [email protected] <- Another alias
When any of these destination addresses is specified, DSPAM will process
mail under the same user so that only one database is used for all of these
addresses. You can create as many aliases as you like, and in fact should
probably write a script to pull this from your existing production system.
Congratulations! You're now set up. You can start DSPAM using dspam --daemon.
You might want to run with verbose debug to test and ensure everything is
working properly.
GLOBAL DATABASES
If you're thinking about going with a global database, I strongly recommend
using merged groups + toe instead of a single global group. To do this, just
follow the README directions for setting one up and leave everything the way
it is. If, however, you insist on a single global group, you'll need to make
one change to dspam.conf to accomodate this configuration. Add
--user [globaluser] to your ServerParameters property. This will cause all
mail to be processed using this user, but will still deliver using the
recipient information.
ALIASES
If you have some aliases, you'll need to also set them up on your relay
appliance so that DSPAM can process the individual users. To do this, add the
following lines to postfix's main.cf:
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/valiases.cf
now create a valiases.cf similar to vmailbox.cf, only you'll want to create
a new table just for aliases. the field pulled from should be a list of
recipient addresses, for example:
[email protected] [email protected],[email protected]
postfix will now deliver to each of these mailboxes instead of an alias address
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Dspam-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-user