(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
To view the compile options on an existing installation of dspam use this command: | To view the compile options on an existing installation of dspam use this command: | ||
+ | dspam --version | ||
− | |||
− | + | == Prerequisites == | |
+ | Depending on the storage driver you intend to use you will need to have that database backend installed before compiling dspam.<br> | ||
+ | mysql_drv: MySQL client libraries (and a server to connect to)<br> | ||
+ | pgsql_drv: PostgreSQL client libraries (and a server to connect to)<br> | ||
+ | sqlite_drv: SQLite v2.7.7 or above<br> | ||
+ | sqlite3_drv: SQLite v3.x<br> | ||
+ | hash_drv: None (Self-Contained Hash-Based Driver)<br> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | '' | + | == Compile Options == |
− | < | + | ''Note: these are the compile options I typically use. There are many more options to suit other needs'' |
+ | <br> | ||
+ | |||
+ | --prefix=/usr/local \<br> | ||
+ | --sysconfdir=/etc \<br> | ||
+ | --with-dspam-home=/usr/local/var/dspam \<br> | ||
+ | --with-logdir=/var/log/dspam \<br> | ||
+ | --with-storage-driver=mysql_drv \<br> | ||
+ | --enable-daemon \<br> | ||
+ | --with-mysql-libraries=/usr/lib/mysql \<br> | ||
+ | --with-mysql-includes=/usr/include/mysql \<br> | ||
+ | --enable-virtual-users \<br> | ||
+ | --enable-preferences-extension \<br> | ||
+ | --enable-domain-scale \<br> | ||
+ | --enable-debug<br> | ||
+ | |||
+ | ''Note: If you have installed on Ubuntu via Package and you want to upgrade to a newer version use these compile options so that the paths match the previous Package installation. | ||
+ | |||
+ | --prefix=/usr \ | ||
+ | --sysconfdir=/etc/dspam \ | ||
+ | --with-dspam-home=/var/spool/dspam \ | ||
+ | --with-logdir=/var/log/dspam \ | ||
+ | --with-storage-driver=mysql_drv \ | ||
+ | --enable-daemon \ | ||
+ | --with-mysql-libraries=/usr/lib/mysql \ | ||
+ | --with-mysql-includes=/usr/include/mysql \ | ||
+ | --enable-virtual-users \ | ||
+ | --enable-preferences-extension \ | ||
+ | --enable-debug | ||
+ | |||
+ | |||
+ | == Download & Install == | ||
+ | wget <nowiki>http://dspam.nuclearelephant.com/sources/dspam-3.X.X.tar.gz</nowiki> | ||
+ | <br> | ||
tar -xvzf dspam-3.X.X.tar.gz | tar -xvzf dspam-3.X.X.tar.gz | ||
cd dspam-3.X.X | cd dspam-3.X.X | ||
<br> | <br> | ||
./configure \ | ./configure \ | ||
− | --sysconfdir=/etc | + | --sysconfdir=/etc/dspam \ |
--enable-daemon \ | --enable-daemon \ | ||
--enable-clamav \ | --enable-clamav \ | ||
Line 36: | Line 64: | ||
--enable-virtual-users \ | --enable-virtual-users \ | ||
--enable-preferences-extension \ | --enable-preferences-extension \ | ||
+ | --enable-domain-scale \ | ||
--enable-debug \ | --enable-debug \ | ||
--with-logdir=/var/log/dspam | --with-logdir=/var/log/dspam | ||
Line 41: | Line 70: | ||
make && make install | make && make install | ||
<br> | <br> | ||
− | + | ||
+ | |||
+ | |||
+ | == File Permissions == | ||
+ | |||
+ | File permissions can drive you nutz when installing dspam.<br> | ||
+ | Here are a few tips.<br> | ||
+ | <br> | ||
+ | 1. Create a 'dspam' Group and 'dspam' User<br> | ||
+ | groupadd dspam | ||
+ | useradd -M -s /sbin/nologin -g dspam dspam | ||
+ | 2. change ownership of all dspam files to be owned by dspam.dspam | ||
+ | chown dspam.dspam dspam_files | ||
+ | 3. set the sticky bit (SUID) for the dspam executable (/usr/local/bin/dspam) | ||
+ | chmod 4510 /usr/local/bin/dspam | ||
+ | 4. set the correct file permissions of all of the dspam files see: [[DSpam File Permissions]] | ||
+ | |||
+ | |||
+ | == Configuration == | ||
+ | All of DSpam's configuration takes place within dspam.conf (typically located in: /etc/dspam.conf or /etc/dspam/dspam.conf) | ||
+ | |||
+ | Read through dspam.conf, it contains explanations for each configuration option. | ||
+ | If you are still unsure after reading dspam.conf, try reading the 'README' (AKA documentation). If that doesn't help try [http://www.google.com/linux Google] and if that still doesn't shed any light on your problem join the the IRC channel #dspam at irc.freenode.net | ||
+ | |||
+ | More to Come! | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == MySQL == | ||
+ | To use DSpam with MySQL you need a functional MySQL Server before you compile DSpam (or at least have the mysql libs installed). | ||
+ | Read the mysql_drv.txt file in the doc/ directory. | ||
+ | |||
+ | 1. Once you have MySQL installed and running you need to create a user within MySQL that has permission to SELECT, INSERT, UPDATE, and DELETE.<br> | ||
+ | GRANT SELECT, INSERT, UPDATE, DELETE ON dspam.* TO 'postfix'@'localhost' IDENTIFIED BY 'SomePassword'; | ||
+ | 2. You need to create the DSpam database | ||
+ | mysqladmin -u root -p CREATE dspam | ||
+ | |||
+ | 3. Import the dspam tables into MySQL | ||
+ | There are several files under src/tools.mysql. Choose one of these files depending on your needs (Speed, Space, Etc...) and insert it into MySQL to create the Table structure DSpam needs.<br> | ||
+ | In this case '''Virtual Users''' will be implemented so we need to insert two table structures. | ||
+ | mysql -u root -p dspam < mysql_objects-4.1.sql | ||
+ | mysql -u root -p dspam < virtual_users.sql | ||
+ | |||
+ | 4. Edit the MySQL options in /etc/dspam.conf | ||
+ | MySQLServer /var/lib/mysql/mysql.sock | ||
+ | MySQLPort 3306 | ||
+ | MySQLUser dspam | ||
+ | MySQLPass SomePassword | ||
+ | MySQLDb dspam | ||
+ | MySQLCompress true | ||
+ | |||
+ | MySQLVirtualTable dspam_virtual_uids | ||
+ | MySQLVirtualUIDField uid | ||
+ | MySQLVirtualUsernameField username | ||
+ | |||
+ | |||
+ | |||
[[Category:DSpam]] | [[Category:DSpam]] |
Latest revision as of 21:20, 30 December 2007
To view the compile options on an existing installation of dspam use this command:
dspam --version
Contents
Prerequisites
Depending on the storage driver you intend to use you will need to have that database backend installed before compiling dspam.
mysql_drv: MySQL client libraries (and a server to connect to)
pgsql_drv: PostgreSQL client libraries (and a server to connect to)
sqlite_drv: SQLite v2.7.7 or above
sqlite3_drv: SQLite v3.x
hash_drv: None (Self-Contained Hash-Based Driver)
Compile Options
Note: these are the compile options I typically use. There are many more options to suit other needs
--prefix=/usr/local \
--sysconfdir=/etc \
--with-dspam-home=/usr/local/var/dspam \
--with-logdir=/var/log/dspam \
--with-storage-driver=mysql_drv \
--enable-daemon \
--with-mysql-libraries=/usr/lib/mysql \
--with-mysql-includes=/usr/include/mysql \
--enable-virtual-users \
--enable-preferences-extension \
--enable-domain-scale \
--enable-debug
Note: If you have installed on Ubuntu via Package and you want to upgrade to a newer version use these compile options so that the paths match the previous Package installation.
--prefix=/usr \ --sysconfdir=/etc/dspam \ --with-dspam-home=/var/spool/dspam \ --with-logdir=/var/log/dspam \ --with-storage-driver=mysql_drv \ --enable-daemon \ --with-mysql-libraries=/usr/lib/mysql \ --with-mysql-includes=/usr/include/mysql \ --enable-virtual-users \ --enable-preferences-extension \ --enable-debug
Download & Install
wget http://dspam.nuclearelephant.com/sources/dspam-3.X.X.tar.gz
tar -xvzf dspam-3.X.X.tar.gz cd dspam-3.X.X
./configure \ --sysconfdir=/etc/dspam \ --enable-daemon \ --enable-clamav \ --with-storage-driver=mysql_drv \ --with-mysql-libraries=/usr/lib/mysql \ --with-mysql-includes=/usr/include/mysql \ --enable-virtual-users \ --enable-preferences-extension \ --enable-domain-scale \ --enable-debug \ --with-logdir=/var/log/dspam
make && make install
File Permissions
File permissions can drive you nutz when installing dspam.
Here are a few tips.
1. Create a 'dspam' Group and 'dspam' User
groupadd dspam useradd -M -s /sbin/nologin -g dspam dspam
2. change ownership of all dspam files to be owned by dspam.dspam
chown dspam.dspam dspam_files
3. set the sticky bit (SUID) for the dspam executable (/usr/local/bin/dspam)
chmod 4510 /usr/local/bin/dspam
4. set the correct file permissions of all of the dspam files see: DSpam File Permissions
Configuration
All of DSpam's configuration takes place within dspam.conf (typically located in: /etc/dspam.conf or /etc/dspam/dspam.conf)
Read through dspam.conf, it contains explanations for each configuration option. If you are still unsure after reading dspam.conf, try reading the 'README' (AKA documentation). If that doesn't help try Google and if that still doesn't shed any light on your problem join the the IRC channel #dspam at irc.freenode.net
More to Come!
MySQL
To use DSpam with MySQL you need a functional MySQL Server before you compile DSpam (or at least have the mysql libs installed). Read the mysql_drv.txt file in the doc/ directory.
1. Once you have MySQL installed and running you need to create a user within MySQL that has permission to SELECT, INSERT, UPDATE, and DELETE.
GRANT SELECT, INSERT, UPDATE, DELETE ON dspam.* TO 'postfix'@'localhost' IDENTIFIED BY 'SomePassword';
2. You need to create the DSpam database
mysqladmin -u root -p CREATE dspam
3. Import the dspam tables into MySQL
There are several files under src/tools.mysql. Choose one of these files depending on your needs (Speed, Space, Etc...) and insert it into MySQL to create the Table structure DSpam needs.
In this case Virtual Users will be implemented so we need to insert two table structures.
mysql -u root -p dspam < mysql_objects-4.1.sql mysql -u root -p dspam < virtual_users.sql
4. Edit the MySQL options in /etc/dspam.conf
MySQLServer /var/lib/mysql/mysql.sock MySQLPort 3306 MySQLUser dspam MySQLPass SomePassword MySQLDb dspam MySQLCompress true
MySQLVirtualTable dspam_virtual_uids MySQLVirtualUIDField uid MySQLVirtualUsernameField username