Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of Extman,maildrop and clamav-0.97.7 in the fifth series of mail services

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Before we have completed the installation and configuration of the basic mail system, let's install and configure Extman-1.1,maildrop and clamav-0.97.7 to complete the construction of the entire mail service system.

one。 Install Extman-1.1

1. Installation and basic configuration

# tar zxvf extman-1.1.tar.gz

# mv extman-1.1 / var/www/extsuite/extman

Modify the configuration file to meet the needs of this example:

# cp / var/www/extsuite/extman/webman.cf.default / var/www/extsuite/extman/webman.cf

# vi / var/www/extsuite/extman/webman.cf

SYS_MAILDIR_BASE = / home/domains

Here is the storage directory of the user mail you set up earlier, which can be changed to:

SYS_MAILDIR_BASE = / var/mailbox

SYS_DEFAULT_UID = 1000

SYS_DEFAULT_GID = 1000

The ID number set later in these two places needs to be changed to the id number of the postfix user and postfix group created before. This article uses 2525, so the above two items need to be modified to:

SYS_DEFAULT_UID = 2525

SYS_DEFAULT_GID = 2525

SYS_MYSQL_USER = webman

SYS_MYSQL_PASS = webman

Modified to:

SYS_MYSQL_USER = extmail

SYS_MYSQL_PASS = extmail

Then modify the owner of the cgi directory:

# chown-R postfix.postfix / var/www/extsuite/extman/cgi/

In the virtual hosts section of Extmail in the main configuration file of apache, add the following two lines:

ScriptAlias / extman/cgi / var/www/extsuite/extman/cgi

Alias / extman/ var/www/extsuite/extman/html

Create a temporary directory for its runtime and modify its corresponding permissions:

# mkdir-pv / tmp/extman

# chown postfix.postfix / tmp/extman

Modify

SYS_CAPTCHA_ON = 1

For

SYS_CAPTCHA_ON = 0

All right, after restarting the apache server, your Webmail and Extman are ready to use. You can enter the name of the specified virtual host in the browser to access it, as follows:

Http://mail.magedu.com

Select Management to log in to extman for background management. The default administrative account is: root@extmail.org password: extmail*123*

Description:

(1) if you cannot display the check code properly after installation, installing the perl-GD module will solve this problem. If you want to make it simple, you can download the rpm package suitable for your platform at the following address and install it: http://dries.ulyssis.org/rpm/packages/perl-GD/info.html

(2) extman-1.1 comes with the function of graphically displaying the log; this function requires the support of rrdtool, and you need to install these modules to display the graphical log normally.

2. Configure Mailgraph_ext and use the graphic log of Extman: (download the software package you need below)

Next, install the software packages Time::HiRes, File::Tail and rrdtool needed for the operation of the graphics log, in which the first two packages can be searched and downloaded from http://search.cpan.org, and the latter can be downloaded from http://oss.oetiker.ch/rrdtool/pub/?M=D; note that the installation order cannot be changed.

Install Time::HiRes

# tar zxvf Time-HiRes-1.9707.tar.gz

# cd Time-HiRes-1.9707

# perl Makefile.PL

# make

# make test

# make install

Install File::Tail

# tar zxvf File-Tail-0.99.3.tar.gz

# cd File-Tail-0.99.3

# perl Makefile

# make

# make test

# make install

Install rrdtool-1.2.23

# tar zxvf rrdtool-1.2.23.tar.gz

# cd rrdtool-1.2.23

#. / configure-prefix=/usr/local/rrdtool

# make

# make install

Create the necessary symbolic links (Extman will go to these paths to find the relevant library files)

# ln-sv / usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/auto/RRDs/RRDs.so / usr/lib/perl5/5.8.5/i386-linux-thread-multi/

# ln-sv / usr/local/rrdtool/lib/perl/5.8.5/RRDp.pm / usr/lib/perl5/5.8.5

# ln-sv / usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/RRDs.pm / usr/lib/perl5/5.8.5

Copy mailgraph_ext to / usr/local and start it

# cp-r / var/www/extsuite/extman/addon/mailgraph_ext / usr/local

# / usr/local/mailgraph_ext/mailgraph-init start

Start cmdserver (display system information in the background)

# / var/www/extsuite/extman/daemon/cmdserver-daemon

Add to the auto start queue

# echo "/ usr/local/mailgraph_ext/mailgraph-init start" > > / etc/rc.d/rc.local

# echo "/ var/www/extsuite/extman/daemon/cmdserver-v-d" > > / etc/rc.d/rc.local

Usage: wait about 15 minutes, if the mail system has a certain amount of traffic, you can log in to extman, click "graphic log" to see the graphical log. For every day, week, month and year, click on the corresponding picture to enter.

two。 Configure postfix to use maildrop to deliver mail

Maildrop is a mail delivery agent with filtering function written in C++ to replace the local MDA. It is one of the components of the courier mail system. It accepts information from standard input and delivers it to the user's mailbox; maildrop can deliver messages to either mailboxes or maildirs mailboxes. At the same time, maildrop can read inbound mail filtering instructions from the file and decide whether to send the message to the user's mailbox or forward it to another address. Unlike procmail, maildrop uses a structured filtering language, so mail system administrators can develop their own filtering rules and apply them.

Here we will use maildrop to replace the MDA that comes with postfix, and use this as a basis to expand the invocation of the email antivirus and anti-spam functions later; many of the settings in the previous article may be modified here, please make sure that your settings have been modified accordingly.

1. Installation

Link the courier-authlib header file and library file (see section 4 of part 8) to the / usr directory (where you will find these related files when compiling maildrop):

# ln-sv / usr/local/courier-authlib/bin/courierauthconfig / usr/bin

# ln-sv / usr/local/courier-authlib/include/* / usr/include

Maildrop needs the support of pcre, so it is necessary to provide development components such as pcre header file and library file in advance. If you choose to provide pcre as a yum source, be sure to install the pcre-devel package.

# yum-y install pcre-devel

# groupadd-g 1001 vmail

# useradd-g vmail-u 1001-M-s / sbin/nologin vmail

# tar xf maildrop-2.6.0.tar.bz2

# cd maildrop-2.6.0

#. / configure\

-- enable-sendmail=/usr/sbin/sendmail\

-- enable-trusted-users='root vmail'\

-- enable-syslog=1-- enable-maildirquota\

-- enable-maildrop-uid=1001\

-- enable-maildrop-gid=1001\

-with-trashquota-with-dirsync

# make

# make install

Check the installation results and make sure there is "Courier Authentication Library extension enabled." A sentence appears:

# maildrop-v

Maildrop 2.6.0 Copyright 1998-2005 Double Precision, Inc.

GDBM/DB extensions enabled.

Courier Authentication Library extension enabled.

Maildir quota extension are now always enabled.

This program is distributed under the terms of the GNU General Public

License. See COPYING for additional information.

2. To create a new configuration file / etc/maildroprc file, first specify the logging location of maildrop:

# vi / etc/maildroprc

Add:

Logfile "/ var/log/maildrop.log"

# touch / var/log/maildrop.log

# chown vmail.vmail / var/log/maildrop.log

3. Configure Postfix

Edit master.cf

# vi / etc/postfix/master.cf

Enable the following two lines

Maildrop unix-n n-- pipe

Flags=DRhu user=vmail argv=/usr/local/bin/maildrop-d ${recipient}

Note: when defining a transport, like the second line in the previous two lines, the parameter line must start with a space, otherwise an error will occur.

Edit main.cf

# vi / etc/postfix/main.cf

Virtual_transport = virtual

Modified to:

Virtual_transport = maildrop

Modify the following two specified UID and GID accordingly:

Virtual_uid_maps = static:2525

Virtual_gid_maps = static:2525

Modified to:

Virtual_uid_maps = static:1001

Virtual_gid_maps = static:1001

4. Edit / etc/authmysqlrc

# vi / etc/authmysqrc

MYSQL_UID_FIELD '2525'

MYSQL_GID_FIELD '2525'

Change to:

MYSQL_UID_FIELD '1001'

MYSQL_GID_FIELD '1001'

Note: without the changes here, maildrop may report an error report for "signal 0x06".

5. Edit / etc/httpd/httpd.conf, modify the running user:

If the suexec feature is enabled, the specified

SuexecUserGroup postfix postfix

Modified to:

SuexecUserGroup vmail vmail

If the above functions are not used, the user after modifying the User and Group instructions is vmail

Change the items in the previous article as follows

User postfix

Group postfix

Modified to:

User vmail

Group vmail

6. Specify the owner and group of the directory / var/mailbox where the user's mail is located and the temporary directory of extman / tmp/extman as vmail

# chown-R vmail.vmail / var/mailbox

# chown-R vmail.vmail / tmp/extman

7. Modify the default user ID and group ID in the main configuration file of extman to make sure they are similar to the following

SYS_DEFAULT_UID = 1001

SYS_DEFAULT_GID = 1001

8. Correction

Next, restart postfix and apache, and after the sending test, if the record class in the log is the same as the following, the installation is successful

Apr 15 15:33:54 localhost postfix/pipe [11964]: 04B92147CE9: to=, relay=maildrop, delay=0.16, delays=0.07/0.03/0/0.07, dsn=2.0.0, status=sent (delivered via maildrop service)

Third, install clamav-0.97.7

The latest clamav-0.97.7 needs to be supported by a version of zlib-1.2.2 or above, so you need to install the corresponding version of zlib-devel; on RHEL5.8 and install it using the system yum source.

1. Install clamav-0.97.7

Add the groups and users required for ClamAV to run:

# groupadd clamav

# useradd-g clamav-s / sbin/nologin-M clamav

Add user amavis for use with amavisd-new

# groupadd amavis

# useradd-g amavis-s / sbin/nologin-M amavis

# tar zxvf clamav-0.97.7.tar.gz

# cd clamav-0.97.7

#. / configure-prefix=/usr/local/clamav-with-dbdir=/usr/local/clamav/share-sysconfdir=/etc/clamav

# make

# make check

# make install

3. Configure Clam AntiVirus:

Edit the main profile:

# vim / etc/clamav/clamd.conf

Comment out the Example on line 8, as follows:

# Example

Find the following line

# LogFile / tmp/clamd.log

# PidFile / var/run/clamd.pid

LocalSocket / tmp/clamd.socket

# DatabaseDirectory / var/lib/clamav

# User clamav

Modified to:

LogFile / var/log/clamav/clamd.log

PidFile / var/run/clamav/clamd.pid

LocalSocket / var/run/clamav/clamd.socket

DatabaseDirectory / usr/local/clamav/share

User amavis

Enable the following options

LogSyslog yes

LogFacility LOG_MAIL

LogVerbose yes

StreamMaxLength 20M

Note: the value after the last parameter above should be consistent with the maximum attachment value allowed by the mail server

Edit the configuration file for the update process

# vim / etc/clamav/freshclam.conf

Comment out the Example as follows:

# Example

Find the following line

# DatabaseDirectory / var/lib/clamav

# UpdateLogFile / var/log/freshclam.log

PidFile / var/run/freshclam.pid

Modify it as follows:

DatabaseDirectory / usr/local/clamav/share

UpdateLogFile / var/log/clamav/freshclam.log

PidFile / var/run/clamav/freshclam.pid

Enable the following options:

DatabaseMirror db.XY.clamav.net (you can also change XY to your country code here, for example, we use cn instead)

LogSyslog yes

LogFacility LOG_MAIL

LogVerbose yes

4. Create the directory where the log is located, the directory where the process and socket are located, and make it belong to the clamav user:

# mkdir-v / var/log/clamav

# chown-R amavis.amavis / var/log/clamav

# mkdir-v / var/run/clamav

# chmod 700 / var/run/clamav

# chown-R amavis.amavis / var/run/clamav

Set up a log file for freshlog

# touch / var/log/clamav/freshclam.log

# chown clamav.clamav / var/log/clamav/freshclam.log

5. Configure crontab to let Clam AntiVirus detect the new virus database every hour:

# crontab-e

Add:

37 * / usr/local/clamav/bin/freshclam

6. Configure the search path for library files:

# echo "/ usr/local/clamav/lib" > > / etc/ls.so.conf

# ldconfig-v

7. Configure clamav to boot automatically.

# cp contrib/init/RedHat/clamd / etc/rc.d/init.d/clamd

# cp contrib/init/RedHat/clamav-milter / etc/rc.d/init.d/clamav-milter

# chkconfig-add clamd

# chkconfig-add clamav-milter

# chkconfig-- level 2345 clamd on

# chkconfig-- level 2345 clamav-milter on

Edit / etc/rc.d/init.d/clamd to point the path of the service process to the installation directory just now

# vi / etc/rc.d/init.d/clamd

Find the following line

Progdir= "/ usr/local/sbin"

Modified to:

Progdir= "/ usr/local/clamav/sbin"

Start clamd

# service clamd start

Since then, we have completed the construction of a mail service system, and this is the end of this series. Next, we will continue to learn how to build a ftp server. I am very happy to share my learning process with you. I hope to have a good exchange with you. I also look forward to the criticism and correction from many enthusiasts and make progress with you.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report