发新话题
 搜藏 打印 该页面添加到 Mister Wong

完整qmail 解决方案

完整qmail 解决方案

Create an E-Mail Toaster
qmail + vpopmail + qmailadmin + vQamin + maildrop + qmail-scanner + SpamAssassin + ClamAV+ sqWebMail + Squirrelmail + MRTG

1. Start with a clean install of RedHat 9.0
If you are building a mail server from the ground up, you may want to install a clean operating system. This tutorial assumes that your OS is RedHat Linux 9.0, however, it should work for other flavors of Linux/Unix without too much modification. Choose a “server install” as we will need some of the packages that this mode installs by default; you will also want to install all the MySQL packages as well. You will find that you don't even need to install X-Windows (X-Windows burns up a lot of room, and you'll probably be spending all your time in a shell all the time anyway!).

By default, vpopmail (the virtual domain add-on for qmail) stores all the e-mail under /home/vpopmail. For this reason, you should consider the size of your /home volume. If you plan on generating a large volume of e-mails, you should adjust your /home volume accordingly. I typically partition an additional hard drive just for the /home volume.

2. Remove existing sendmail/pop/imap/httpd servers
rpm -e --nodeps sendmail
rpm -e –-nodeps openssl
#rpm -e --nodeps apache
Next, make sure that you have these packages installed:

rpm -q gdbm
rpm -q gdbm-devel
rpm -q openssl
rpm -q openssl-devel
rpm -q stunnel
rpm -q openssl-0.9.7a-2.i686.rpm
rpm -q mod_ssl-2.0.40-21.i386.rpm
rpm -q openssl-devel-0.9.7a-2.i386.rpm
rpm -q openssl-perl-0.9.7a-2.i386.rpm
rpm -q krb5-devel-1.2.7-10.i386.rpm
rpm -q krb5-server-1.2.7-10.i386.rpm
rpm -q krb5-workstation-1.2.7-10.i386.rpm
rpm -q krb5-libs-1.2.7-10.i386.rpm
rpm -q pam_krb5-1.60-1.i386.rpm
rpm -q mysql-devel-3.23.54a-11.i386.rpm
# for qmail-scanner you may need perl-suidperl.  I got mine at http://www.megaloman.com/~hany/RPM/doors4.0/jr/PByName.html
rpm -q perl-suidperl
If you do not have these packages installed, download them and install them now. You should be able to find all these RPMs at http://www.rpmfind.net. I found my “perl-suidperl” at http://www.megaloman.com/~hany/R ... .8.0-55.1.i586.html

3. Download needed packages and put them in /var/src

mkdir -p /var/src/tar
cd /var/src/tar
# Needed packages
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
wget http://cr.yp.to/software/qmail-1.03.tar.gz
wget http://www.shupp.org/patches/qmail-toaster-0.5.patch.bz2 (make sure to download this link to MY SITE!!)
wget http://www.jerfu.com/downloads/toaster/qmail-toaster-0.4.7.patch
wget http://www.inter7.com/devel/vpopmail-5.3.20.tar.gz
wget http://www.inter7.com/devel/autorespond-2.0.3.tar.gz
wget http://www.inter7.com/devel/vqadmin-2.3.5.tar.gz
wget http://www.inter7.com/devel/qmailadmin-1.0.20.tar.gz
wget http://cr.yp.to/software/ezmlm-0.53.tar.gz
wget http://www.qmail.org/moni.csi.hu ... .53.400-10.i386.rpm
wget http://www.qmail.org/moni.csi.hu ... .53.400-10.i386.rpm
wget http://www.jerfu.com/downloads/toaster/idx.shupp.patch.gz
wget http://telia.dl.sourceforge.net/ ... -imap-2.0.0.tar.bz2
wget http://www.jerfu.com/downloads/toaster/toaster-scripts.tar.gz

# Optional packages
wget http://www.jerfu.com/downloads/toaster/optionalScripts.tar.gz
wget http://telia.dl.sourceforge.net/ ... elmail-1.4.0.tar.gz
wget http://www.spamassassin.org/rele ... ssassin-2.55.tar.gz
wget http://telia.dl.sourceforge.net/ ... il-scanner-1.16.tgz
wget http://download.sourceforge.net/courier/maildrop-1.5.3.tar.bz2
wget http://telia.dl.sourceforge.net/ ... f/tnef-1.2.1.tar.gz
# Download the perl-suidperl RPM.  If you aren't using RedHat
# you may need to find an alternate way of getting perl-suidperl installed.
wget ftp://rpmfind.net/linux/redhat/7 ... .1-34.99.6.i386.rpm
# Virus related optional packages
wget http://clamav.elektrapro.com/stable/clamav-0.60.tar.gz
# Test virus files
wget http://www.eicar.org/download/eicar.com
wget http://www.eicar.org/download/eicar.com.txt
wget http://www.eicar.org/download/eicar_com.zip
wget http://www.eicar.org/download/eicarcom2.zip
# Download MRTG and supporting packages
wget http://www.boutell.com/gd/http/gd-2.0.9.tar.gz
wget http://www.libpng.org/pub/png/src/old/libpng-1.0.12.tar.gz
wget http://www.libpng.org/pub/png/src/zlib-1.1.4.tar.gz
wget http://www.inter7.com/qmailmrtg7/qmailmrtg7-3.4.tar.gz
wget http://people.ee.ethz.ch/~oetike ... /mrtg-2.9.29.tar.gz
# Download PATCHES for the qmail apps for RH9
wget http://qmail.org/moni.csi.hu/pub ... ls-0.76.errno.patch
wget http://qmail.org/moni.csi.hu/pub ... il-1.03.errno.patch
wget http://qmail.org/moni.csi.hu/pub ... cp-0.88.errno.patch
wget http://qmail.org/moni.csi.hu/pub ... ls-0.76.errno.patch
wget http://qmail.org/moni.csi.hu/pub ... ls-0.76.errno.patch

4. Install daemontools
daemontools is a collection of tools for managing UNIX services. It will monitor qmail-send, and qmail-smtpd, and qmail-pop3d services.

The below steps assume that your "rc" directories are in /etc/rc.d, and your "init.d" path is "/etc/rc.d/init.d". If yours are different, please substitute paths accordingly.

mkdir -p /package
chmod 1755 /package
cd /package
tar -xpzf /var/src/tar/daemontools-0.76.tar.gz
cd admin/daemontools-0.76
patch -p1 < /var/src/tar/daemontools-0.76.errno.patch
package/install

5. Install ucspi-tcp
ucspi-tcp contains tcpserver and tcpclient command line tools for building client-server applications.

cd /var/src/
tar -xzf tar/ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
patch -p1 < /var/src/tar/ucspi-tcp-0.88.errno.patch
make
make setup check


6. Install qmail
qmail is a replacement for sendmail. It's fast, free, and easy to use. Follow the next steps closely.

mkdir /var/qmail
/usr/sbin/groupadd nofiles
/usr/sbin/useradd -g nofiles -d /var/qmail/alias alias
/usr/sbin/useradd -g nofiles -d /var/qmail qmaild
/usr/sbin/useradd -g nofiles -d /var/qmail qmaill
/usr/sbin/useradd -g nofiles -d /var/qmail qmailp
/usr/sbin/groupadd qmail
/usr/sbin/useradd -g qmail -d /var/qmail qmailq
/usr/sbin/useradd -g qmail -d /var/qmail qmailr
/usr/sbin/useradd -g qmail -d /var/qmail qmails

# we need to add the vpopmail user here
/usr/sbin/groupadd vchkpw
/usr/sbin/useradd -g vchkpw vpopmail

cd /var/src
tar -xzf tar/qmail-1.03.tar.gz
tar -xzf tar/toaster-scripts.tar.gz
bzip2 -d tar/qmail-toaster-0.5.patch.bz2

cd qmail-1.03
patch -p0 < ../tar/qmail-toaster-0.4.7.patch
patch -p1 < ../tar/qmail-1.03.errno.patch
make
make setup check

(cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root)
chmod 644 ~alias/.qmail*

# on the next line replace "full.hostname" with the hostname of your mail server
./config-fast full.hostname

make cert
# enter your company's information

cd /var/qmail/control
rm clientcert.pem
cp servercert.pem clientcert.pem
chown qmaild.qmail clientcert.pem

cp /var/src/toaster-scripts/rc /var/qmail/rc
chmod 755 /var/qmail/rc
mkdir /var/log/qmail
echo ./Maildir/ >/var/qmail/control/defaultdelivery
cp /var/src/toaster-scripts/qmailctl /var/qmail/bin/

#Make qmail start at boot time.

ln -s ../init.d/qmail /etc/rc.d/rc0.d/K30qmail
ln -s ../init.d/qmail /etc/rc.d/rc1.d/K30qmail
ln -s ../init.d/qmail /etc/rc.d/rc2.d/S80qmail
ln -s ../init.d/qmail /etc/rc.d/rc3.d/S80qmail
ln -s ../init.d/qmail /etc/rc.d/rc4.d/S80qmail
ln -s ../init.d/qmail /etc/rc.d/rc5.d/S80qmail
ln -s ../init.d/qmail /etc/rc.d/rc6.d/K30qmail

ln -s /var/qmail/bin/qmailctl /etc/rc.d/init.d/qmail

chmod 755 /var/qmail/bin/qmailctl
ln -s /var/qmail/bin/qmailctl /usr/bin
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail

#Now create the supervise directories/scripts for the qmail services:
mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpd/log
mkdir -p /var/qmail/supervise/qmail-pop3d/log
mkdir -p /var/qmail/supervise/qmail-pop3ds/log
chmod +t /var/qmail/supervise/qmail-send
chmod +t /var/qmail/supervise/qmail-smtpd
chmod +t /var/qmail/supervise/qmail-pop3d/log
chmod +t /var/qmail/supervise/qmail-pop3ds/log
cp /var/src/toaster-scripts/send.run /var/qmail/supervise/qmail-send/run
cp /var/src/toaster-scripts/send.log.run /var/qmail/supervise/qmail-send/log/run
cp /var/src/toaster-scripts/smtpd.run /var/qmail/supervise/qmail-smtpd/run
cp /var/src/toaster-scripts/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run
cp /var/src/toaster-scripts/pop3d.run /var/qmail/supervise/qmail-pop3d/run
cp /var/src/toaster-scripts/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run
cp /var/src/toaster-scripts/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run
cp /var/src/toaster-scripts/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run
echo 20 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming
chmod 755 /var/qmail/supervise/qmail-send/run
chmod 755 /var/qmail/supervise/qmail-send/log/run
chmod 755 /var/qmail/supervise/qmail-smtpd/run
chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
chmod 755 /var/qmail/supervise/qmail-pop3d/run
chmod 755 /var/qmail/supervise/qmail-pop3d/log/run
chmod 755 /var/qmail/supervise/qmail-pop3ds/run
chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run
mkdir -p /var/log/qmail/smtpd
mkdir -p /var/log/qmail/pop3d
mkdir -p /var/log/qmail/pop3ds
chown qmaill /var/log/qmail /var/log/qmail/smtpd
chown qmaill /var/log/qmail/pop3d /var/log/qmail/pop3ds

#allow daemontools to start qmail
ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service

#verify that it's running with qmailctl
qmailctl stat
qmail should now be up and running. I suggest reviewing steps 2 through 6 to help "cement" in your mind what we just did. We will now move on to the vpopmail section of the install

7. Install Vpopmail
Vpopmail is a virtual domain package add-on for qmail. It can handle multiple domains on a single IP address, and none of the user accounts are /etc/passwd or "system" accounts. NICE!

Because we will only be using vchkpw (the pop authentication tool) with qmail-smtpd for SMTP-AUTH, we don't want it to open relays. The patch applied below fixes this.

mysqladmin -u root password [enter new password here]
mysqladmin -u root -p reload
mysqladmin -u root -p refresh

cd /var/src
# the vchkpw group and vpopmail user was created while installing qmail for make cert
tar -xzf tar/vpopmail-5.3.20.tar.gz
cd vpopmail-5.3.20
./configure --enable-roaming-users=y –-enable-logging=y \
     –-enable-learn-passwords=y –-enable-clear-passwd=y \
     --enable-default-domain=your-main-domain-FQDN \
     --enable-mysql –-enable-defaultquota=10M \
     --enable-incdir=/usr/include/mysql/ --enable-libdir=/usr/lib/mysql/

edit the vmysql.h file and change the following lines:
     #define MYSQL_UPDATE_SERVER "localhost"
     #define MYSQL_UPDATE_USER   "root"
     #define MYSQL_UPDATE_PASSWD "[enter new password here]"

     #define MYSQL_READ_SERVER   "localhost"
     #define MYSQL_READ_USER     "root"
     #define MYSQL_READ_PASSWD   "[enter new password here]"

make
make install-strip
echo '127.:allow,RELAYCLIENT=""' >/home/vpopmail/etc/tcp.smtp
qmailctl cdb

# add the followowing line to your crontab via `crontab -e`
9-59,10 * * * * /home/vpopmail/bin/clearopensmtp 2>&1 > /dev/null

# install the vpopmail start script
cp /var/src/toaster-scripts/vpopmailctl /var/qmail/bin/vpopmailctl

#Make vpopmail start at boot time.

ln -s ../init.d/vpopmail /etc/rc.d/rc0.d/K30vpopmail
ln -s ../init.d/vpopmail /etc/rc.d/rc1.d/K30vpopmail
ln -s ../init.d/vpopmail /etc/rc.d/rc2.d/S80vpopmail
ln -s ../init.d/vpopmail /etc/rc.d/rc3.d/S80vpopmail
ln -s ../init.d/vpopmail /etc/rc.d/rc4.d/S80vpopmail
ln -s ../init.d/vpopmail /etc/rc.d/rc5.d/S80vpopmail
ln -s ../init.d/vpopmail /etc/rc.d/rc6.d/K30vpopmail

ln -s /var/qmail/bin/vpopmailctl /etc/rc.d/init.d/vpopmail

chmod 755 /var/qmail/bin/vpopmailctl
ln -s /var/qmail/bin/vpopmailctl /usr/bin

#allow daemontools to start vpopmail
ln -s /var/qmail/supervise/qmail-pop3d /var/qmail/supervise/qmail-pop3ds /service

#verify that it's running with vpopmailctl
vpopmailctl stat

本文由hew 发布于Linuxsky 论坛,网址:http://bbs.linuxsky.org/thread-3638-1-1.html

你的鼓励,我的动力.
做人厚道,看贴回贴.
my linux blog

TOP

go on

8. Install Courier-IMAP
Courier-IMAP will supply IMAP/SIMAP access.

cd /var/src
tar -xjf tar/courier-imap-2.0.0.tar.bz2
cd courier-imap-2.0.0
# configure may take some time...
./configure --disable-root-check --without-authdaemon --with-authvchkpw \
--enable-workarounds-for-imap-client-bugs
make
make install-strip
make install-configure
cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap
chmod 755 /etc/rc.d/init.d/courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc0.d/K30courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc1.d/K30courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc2.d/S80courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc3.d/S80courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc4.d/S80courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc5.d/S80courier-imap
ln -s ../init.d/courier-imap /etc/rc.d/rc6.d/K30courier-imap
Edit /usr/lib/courier-imap/etc/imapd

change:
    'AUTHMODULES="authcustom authcram authuserdb authvchkpw authldap authpam"'
to:
    'AUTHMODULES="authvchkpw"'

change :
    'IMAPDSTART=NO'
to:
    'IMAPDSTART=YES'




Edit /usr/lib/courier-imap/etc/imapd-ssl

change:
    'IMAPDSSLSTART=NO'
to:
    'IMAPDSSLSTART=YES'




NOTE: courier-imap does (should) run under user vpopmail.vchkpw

Edit /usr/lib/courier-imap/libexec/imapd.rc AND /usr/lib/courier-imap/libexec/imapd-ssl.rc as follows:

change:
    /usr/lib/courier-imap/libexec/couriertcpd -address=$ADDRESS \
to:
    /usr/lib/courier-imap/libexec/couriertcpd -address=$ADDRESS \
        -user=vpopmail -group=vchkpw \




Start IMAP server:

/etc/rc.d/init.d/courier-imap start
Make the new imapd.pem certificate readable by vpopmail since that's the user that the imap server runs as

chown vpopmail.vchkpw /usr/lib/courier-imap/share/imapd.pem
OK, we've now made it past the vpopmail install. You should now have qmail and vpopmail up and running.

Again, you may want to review steps 7 and 8 to familiarize yourself with the vpopmail install. We are going to move on to the Apache install next.

9. Prepare your Apache
The Apache Web server is needed for webmail and qmailadmin access. We'll need to prepare it for our needs.

Now (and this is important), edit your /etc/httpd/conf/httpd.conf file.

Replace the <Directory /var/www/cgi-bin/> contents with this:

<Directory /var/www/cgi-bin/>
    AllowOverride All
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>
Start up the Apache web server:

/usr/sbin/apachectl restart

10. Install SqWebmail
SqWebmail is a web cgi client that provides direct access to users' mailboxes, bypassing the need for a pop or imap client in between.

cd /var/src
tar -xjf tar/sqwebmail-3.4.0.20021026.tar.bz2
cd sqwebmail-3.4.0.20021026
# configure may take some time...
./configure --without-authdaemon --with-authvchkpw
make
make install-strip
Add the following line to your crontab via `crontab -e`

crontab -e
40 * * * * /usr/local/share/sqwebmail/cleancache.pl 2>&1 > /dev/null

11. Install autorespond
Autorespond is compatible autoresponder/vacation type tool that works well with vdelivermail and qmailadmin.

cd /var/src
tar -xzf tar/autorespond-2.0.3.tar.gz
cd autorespond-2.0.3
make
make install

12. Install ezmlm-idx
Fast, full featured Mailing List Manager configureable from qmailadmin. Sadly, due to some changes in RedHat 9.0, I couldn't get ezmlm to install from source. You'll need to install from RPMs.

cd /var/src/tar
rpm -i ezmlm-idx-std-0.53.400-10.i386.rpm
rpm -i ezmlm-idx-cgi-0.53.400-10.i386.rpm
cp /home/httpd/cgi-bin/ezmlm-cgi /var/www/cgi-bin/
chmod 4755 /var/www/cgi-bin/ezmlm-cgi

13. Install qmailadmin
Qmailadmin can handle nearly all virtual email administration tasks for you from a web browser, except for adding and removing virtual domains. The patch applied below fixes a problem with the default_quota directive used in the .qmailadmin-limits file.

cd /var/src
tar -xzf tar/qmailadmin-1.0.23.tar.gz
cd qmailadmin-1.0.23
#gunzip -cd ../tar/patch-quotafix-1.06.gz | patch -p0
./configure –-enable-cgibindir=/var/www/cgi-bin/ \
            --enable-htmldir=/var/www/html/ \
            --with-htmllibdir=/var/www/html/

make
make install-strip
Your toaster installation is done! Now we're ready to take it for a test drive.

14. Test drive your qmail + vpopmail setup
Here we'll add a virtual domain, test.com, and test sending/receiving mail. Substitue test.com for whatever domain you setup DNS for.

# Add the domain to vpopmail
/home/vpopmail/bin/vadddomain test.com [password]
This creates the default "postmaster" account for test.com. You will use this account with qmailadmin.

Try adding/removing users with qmailadmin. Open up a web browser, and type in the following address:

http://mail.test.com/cgi-bin/qmailadmin
To test out quota usage support, create a user with a 6MB quota like so:

/home/vpopmail/bin/vadduser -q 6000000000S user@test.com [password]
Verify the user settings, and create the "maildirsize" file:

/home/vpopmail/bin/vuserinfo user@test.com
Now, to log into sqwebmail as user@test.com, point your browser here:

http://mail.test.com/cgi-bin/sqwebmail
Send yourself a message. If you get it, it's likely you're up and running.

To test your POP server, try telnetting to port 110 and logging in.

telnet localhost 110

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Hello there.
user user@test.com
+OK Password required.
pass [password]
+OK logged in.
quit
+OK Bye-bye.
Connection closed by foreign host.
Test your IMAP server in the same way:

telnet localhost 143

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
* OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See COPYING for distribution information.
a001 login user@test.com [password]
a001 OK LOGIN Ok.
a001 logout
* BYE Courier-IMAP server shutting down
a001 OK LOGOUT completed
Connection closed by foreign host.

15. Take a break!
Ahhh.... You have a fully functioning mail server. The rest of the stuff if optional, but highly recommend. You can stop now, or you can continue. It's your call.

16. Install vQadmin
vqadmin is a web based control pannel. It allows system administrators to perform actions which require root access.

cd /var/src
tar -zxf tar/vqadmin-2.3.4.tar.gz
cd vqadmin-2.3.4
./configure
make
make install
Now we need to add a few lines to our httpd.conf file:

vi /etc/httpd/conf/httpd.conf
<Directory "/usr/local/apache/cgi-bin/vqadmin">
    deny from all
    Options ExecCGI
    AllowOverride AuthConfig
    Order deny,allow
</Directory>
RedHat 90's default user and group is apache. We need to change that to nobody:

change:
    User apache
    Group apache
to:
    User nobody
    Group nobody
Save the file, and end your vi session.

cd /var/www/cgi-bin/vqadmin/
vi .htaccess
change:
    AuthUserFile /usr/local/apache/conf/vqadmin.passwd
to:
    AuthUserFile /etc/httpd/conf/vqadmin.passwd
chown nobody .htaccess
chmod 600 .htaccess
# Create an admin account with a password:
/usr/bin/htpasswd -bc /etc/httpd/conf/vqadmin.passwd admin adminpass
chown nobody.nobody /etc/httpd/conf/vqadmin.passwd
/usr/sbin/apachectl stop
/usr/sbin/apachectl start
Test out the installation in your favorite broswer:

http://www.test.com/cgi-bin/vqadmin/vqadmin.cgi

17. Install PHP4
PHP4 is needed for Squirrelmail. You should have it installed already; if you don't, install the RPMs from the RH9 install CDs.

vi /etc/php.ini

change:
    register_globals = Off
to:
    register_globals = On

18. Install Squirrelmail
Squirrelmail is a great web-based e-mail client with IMAP support. NOTE: Squirrelmail requires PHP4 to be installed.

cd /var/www/html
tar -xzf /var/src/tar/squirrelmail-1.3.2.tar.gz
mv squirrelmail-1.2.7 squirrelmail
cd squirrelmail
mkdir attachment
chown -R nobody.nobody data
chown -R nobody.nobody attachment
chmod 733 attachment
Now, run the squirrelmail configuration script (the configure routine should be self explanatory):

./configure
The one thing you must do is change the IMAP settings from cyrus to courier. Do this by pressing D at the prompt, then at the next prompt, type courier. Also, you should set up your attachment directory path. From the main menu, press 4, then press 3, and set the path to ../attachment/ and then press s to save and q to quit.

19. Install SpamAssassin
Spam is a dirty word where I come from. Most people don't like it, don't read it, and don't want it. If you want to protect yourself against spam, your should install SpamAssassin. As of the time of writing this, there is a newer version of SpamAssassin (version 2.43); however, many people have reported problems, so we're going to stick with version 2.31.

SpamAssassin requires Time-HiRes. If you don't have it, we'll need to install it.

# Install the Time-HiRes perl module
cd /var/src
# NOTE:  If you are running CPAN for the first time, you will be asked
#   a series of questions.  The defaults are fine for most questions.
#   It should be easy enough to figure out.

# RedHat 9.0 sets LANG=UTF8, which confuses the CPAN Make, so let's get around that problem:
unset $LANG
perl -MCPAN -e'shell'
cpan> install Time::HiRes
cpan> exit

# Install SpamAssassin
cd /var/src
tar -xzf tar/Mail-SpamAssassin-2.55.tar.gz
cd Mail-SpamAssassin-2.55
perl Makefile.PL
make
make install

# Run a spam and non-spam test
spamassassin -t < sample-spam.txt > spamtest.txt
less spamtest.txt
spamassassin -t < sample-nonspam.txt > nonspamtest.txt
less nonspamtest.txt
The spamtest.txt should contain the “X-Spam-Flag: YES” tag, while the nospamtest.txt should not.

20. Install MailDrop and TNEF reader
TNEF is a program for unpacking MIME attachments of type "application/ms-tnef". This is a Microsoft only attachment.

The TNEF program allows one to unpack the attachments which were encapsulated into the TNEF attachment. It is not essential to install TNEF, but it is highly recommended!

cd /var/src
tar -xzf tar/qmail-scanner-1.16.tgz
tar -xjf tar/maildrop-1.5.3.tar.bz2
tar -xzf tar/tnef-1.2.1.tar.gz

# Install maildrop
cd /var/src/maildrop-1.5.3
./configure
make
make install-strip
make install-man

# Install the tnef
cd /var/src/tnef-1.1.3
./configure
make
make install
你的鼓励,我的动力.
做人厚道,看贴回贴.
my linux blog

TOP

发新话题