Install Postfix + courier + MySQL in RedHat

Source: Internet
Author: User
Tags imap rpmbuild
Prepare the compilation environment: # yumgroupinstall 'developmenttool' # yumgroupinstall 'developmentlibraries' # yuminstallmysql-develpostgresql-develexpectlibtool-ltdl-develgamin-develpcre-devel must be compiled under normal users.

Preparations
Install the compiling environment:

# Yum groupinstall 'development tool'
# Yum groupinstall 'development libraries'
# Yum install mysql-devel postgresql-devel submit CT libtool-ltdl-devel gamin-devel pcre-devel
During compilation, you need to add a user under a common user:

# Useradd username
# Passwd username
Use the "cmddo" command to configure sudo and add users:

Root ALL = (ALL) ALL
Username ALL = (ALL) ALL
Switch to this user:

# Su username
Create a working directory:

$ Mkdir $ HOME/rpm
$ Mkdir $ HOME/rpm/SOURCES
$ Mkdir $ HOME/rpm/SPECS
$ Mkdir $ HOME/rpm/BUILD
$ Mkdir $ HOME/rpm/SRPMS
$ Mkdir $ HOME/rpm/RPMS
$ Mkdir $ HOME/rpm/RPMS/i386

$ Echo "% _ topdir $ HOME/rpm"> $ HOME/. rpmmacros

Mkdir $ HOME/downloads
Install Postfix
Because the Postfix package of RedHat does not support MySQL, We Need To package a new version.

Download and install the source code package:

# Wget http://ftp.wl0.org/official/2.5/SRPMS/postfix-2.5.9-1.src.rpm
# Rpm-ivh postfix-2.5.9-1.src.rpm
Modify compilation parameters:

# Cd/usr/src/redhat/SPECS
# Vi postfix. spec
Set the following content in "postfix. spec:

% Define with_cdb 0
% Define with_ldap 1
% Define with_mysql 0
% Define with_mysql_redhat 0
% Define with_pcre 0
% Define with_pgsql 0
% Define with_sasl 0
% Define with_spf 0
% Define with_dovecot 0
% Define with_tls 1
% Define with_tlsfix 2
% Define with_vda 0
To:

% Define with_cdb 0
% Define with_ldap 0
% Define with_mysql 0
% Define with_mysql_redhat 1
% Define with_pcre 0
% Define with_pgsql 0
% Define with_sasl 2
% Define with_spf 0
% Define with_dovecot 1
% Define with_tls 1
% Define with_tlsfix 2
% Define with_vda 0
Re-create rpm package:

# Rpmbuild-ba postfix. spec
Install the new package Postfix:

# Cd/usr/src/redhat/RPMS/i386
# Rpm-ivh postfix-2.5.9-1.rhel5.i386.rpm
Install courier-imap, courier-authlib, and maildrop
1. Download the source code package:

$ Cd $ HOME/downloads
$ Wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.62.4.tar.bz2
$ Wget http://prdownloads.sourceforge.net/courier/courier-imap-4.6.0.tar.bz2
$ Wget http://prdownloads.sourceforge.net/courier/maildrop-2.2.0.tar.bz2
2. Create a courier-imap RPM package and install it:

Generate an RPM package:

$ Cd $ HOME/downloads
$ Sudo rpmbuild-ta courier-authlib-0.62.4.tar.bz2
Install the RPM package:

$ Cd $ HOME/rpm/RPMS/i386
$ Sudo rpm-ivh courier-authlib-0.62.4-1.i386.rpm
$ Sudo rpm-ivh courier-authlib-devel-0.62.4-1.i386.rpm
$ Sudo rpm-ivh courier-authlib-mysql-0.62.4-1.i386.rpm
3. Create a courier-authlib RPM package and install it:

Generate an RPM package:

$ Cd $ HOME/downloads
$ Rpmbuild-ta courier-imap-4.6.0.tar.bz2
Note that "sudo" is not added before the command is generated ".

Install the RPM package:

$ Cd $ HOME/rpm/RPMS/i386
$ Sudo rpm-ivh courier-imap-4.6.0-1.i386.rpm
4. Create and install the RPM package of maildrop:

Generate an RPM package:

$ Cd $ HOME/downloads
$ Sudo rpmbuild-ta maildrop-2.2.0.tar.bz2
Install the RPM package:

$ Cd $ HOME/rpm/RPMS/i386
$ Sudo rpm-ivh maildrop-2.2.0-1.i386.rpm
Install other software
To implement SMTP mail authentication, you must install the "cyrus-sasl" program and directly use YUM to install it:

# Yum install cyrus-sasl-SQL
Install other common software:

# Yum install fetchmail mutt

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.