Courier-Imap: различия между версиями
Sirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
(не показаны 4 промежуточные версии этого же участника) | |||
Строка 1: | Строка 1: | ||
+ | [[Категория:Linux]] |
||
+ | [[Категория:CentOS]] |
||
=Courier-Imap= |
=Courier-Imap= |
||
Строка 9: | Строка 11: | ||
− | + | ==Preliminary Note== |
|
I have tried this on a Fedora 8 (i386) system; it should work for RedHat and CentOS as well. If you are on an x86_64 system, replace all references to i386 in this tutorial with x86_64. |
I have tried this on a Fedora 8 (i386) system; it should work for RedHat and CentOS as well. If you are on an x86_64 system, replace all references to i386 in this tutorial with x86_64. |
||
Строка 22: | Строка 24: | ||
</PRE> |
</PRE> |
||
− | + | ==Creating A Non-Priviledged User Account== |
|
RPM packages should not be built as root; courier-imap will even refuse to compile if it detects that the compilation is run as the root user. Therefore we create a normal user account now (falko in this example) and give him a password: |
RPM packages should not be built as root; courier-imap will even refuse to compile if it detects that the compilation is run as the root user. Therefore we create a normal user account now (falko in this example) and give him a password: |
||
Строка 44: | Строка 46: | ||
</PRE> |
</PRE> |
||
− | + | ==Building courier-authlib, courier-imap, And maildrop== |
|
Now we are ready to build our rpm package. First become the user falko: |
Now we are ready to build our rpm package. First become the user falko: |
||
+ | <PRE> |
||
su falko |
su falko |
||
+ | </PRE> |
||
− | |||
Next we create our build environment: |
Next we create our build environment: |
||
+ | <PRE> |
||
− | |||
mkdir $HOME/rpm |
mkdir $HOME/rpm |
||
mkdir $HOME/rpm/SOURCES |
mkdir $HOME/rpm/SOURCES |
||
Строка 59: | Строка 62: | ||
mkdir $HOME/rpm/RPMS |
mkdir $HOME/rpm/RPMS |
||
mkdir $HOME/rpm/RPMS/i386 |
mkdir $HOME/rpm/RPMS/i386 |
||
+ | </PRE> |
||
− | |||
+ | <PRE> |
||
echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros |
echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros |
||
+ | </PRE> |
||
− | |||
Now we create a downloads directory and download the source files from http://www.courier-mta.org/download.php: |
Now we create a downloads directory and download the source files from http://www.courier-mta.org/download.php: |
||
+ | <PRE> |
||
mkdir $HOME/downloads |
mkdir $HOME/downloads |
||
cd $HOME/downloads |
cd $HOME/downloads |
||
+ | </PRE> |
||
+ | Тут - внимательно надо найти текущюю версию. |
||
+ | <PRE> |
||
wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.60.2.tar.bz2 |
wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.60.2.tar.bz2 |
||
wget http://prdownloads.sourceforge.net/courier/courier-imap-4.2.1.tar.bz2 |
wget http://prdownloads.sourceforge.net/courier/courier-imap-4.2.1.tar.bz2 |
||
wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2 |
wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2 |
||
+ | </PRE> |
||
− | |||
− | + | ===courier-authlib=== |
|
Now (still in $HOME/downloads) we can build courier-authlib: |
Now (still in $HOME/downloads) we can build courier-authlib: |
||
+ | <PRE> |
||
− | |||
sudo rpmbuild -ta courier-authlib-0.60.2.tar.bz2 |
sudo rpmbuild -ta courier-authlib-0.60.2.tar.bz2 |
||
+ | </PRE> |
||
− | |||
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system): |
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system): |
||
+ | <PRE> |
||
− | |||
cd $HOME/rpm/RPMS/i386 |
cd $HOME/rpm/RPMS/i386 |
||
+ | </PRE> |
||
− | |||
The command |
The command |
||
+ | <PRE> |
||
− | |||
ls -l |
ls -l |
||
+ | </PRE> |
||
− | |||
shows you the available rpm packages: |
shows you the available rpm packages: |
||
+ | <PRE> |
||
− | |||
[falko@server1 i386]$ ls -l |
[falko@server1 i386]$ ls -l |
||
total 600 |
total 600 |
||
Строка 99: | Строка 107: | ||
-rw-r--r-- 1 root root 36859 2007-11-13 18:02 courier-authlib-userdb-0.60.2-1.fc8.i386.rpm |
-rw-r--r-- 1 root root 36859 2007-11-13 18:02 courier-authlib-userdb-0.60.2-1.fc8.i386.rpm |
||
[falko@server1 i386]$ |
[falko@server1 i386]$ |
||
+ | </PRE> |
||
− | |||
Select the ones you want to install, and install them like this: |
Select the ones you want to install, and install them like this: |
||
+ | <PRE> |
||
− | |||
sudo rpm -ivh courier-authlib-0.60.2-1.fc8.i386.rpm |
sudo rpm -ivh courier-authlib-0.60.2-1.fc8.i386.rpm |
||
sudo rpm -ivh courier-authlib-devel-0.60.2-1.fc8.i386.rpm |
sudo rpm -ivh courier-authlib-devel-0.60.2-1.fc8.i386.rpm |
||
sudo rpm -ivh courier-authlib-mysql-0.60.2-1.fc8.i386.rpm |
sudo rpm -ivh courier-authlib-mysql-0.60.2-1.fc8.i386.rpm |
||
+ | </PRE> |
||
− | |||
− | + | ===courier-imap=== |
|
Now we go back to our downloads directory: |
Now we go back to our downloads directory: |
||
+ | <PRE> |
||
− | |||
cd $HOME/downloads |
cd $HOME/downloads |
||
+ | </PRE> |
||
− | |||
and run rpmbuild again, this time without sudo, otherwise the compilation will fail because it was run as root: |
and run rpmbuild again, this time without sudo, otherwise the compilation will fail because it was run as root: |
||
+ | <PRE> |
||
− | |||
rpmbuild -ta courier-imap-4.2.1.tar.bz2 |
rpmbuild -ta courier-imap-4.2.1.tar.bz2 |
||
+ | </PRE> |
||
− | |||
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system): |
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system): |
||
+ | <PRE> |
||
cd $HOME/rpm/RPMS/i386 |
cd $HOME/rpm/RPMS/i386 |
||
+ | </PRE> |
||
− | |||
The command |
The command |
||
+ | <PRE> |
||
− | |||
ls -l |
ls -l |
||
+ | </PRE> |
||
− | |||
shows you the available rpm packages: |
shows you the available rpm packages: |
||
+ | <PRE> |
||
− | |||
[falko@server1 i386]$ ls -l |
[falko@server1 i386]$ ls -l |
||
total 1284 |
total 1284 |
||
Строка 140: | Строка 149: | ||
-rw-rw-r-- 1 falko falko 917771 2007-11-13 18:21 courier-imap-debuginfo-4.2.1-1.8.i386.rpm |
-rw-rw-r-- 1 falko falko 917771 2007-11-13 18:21 courier-imap-debuginfo-4.2.1-1.8.i386.rpm |
||
[falko@server1 i386]$ |
[falko@server1 i386]$ |
||
+ | </PRE> |
||
− | |||
You can install courier-imap like this: |
You can install courier-imap like this: |
||
+ | <PRE> |
||
sudo rpm -ivh courier-imap-4.2.1-1.8.i386.rpm |
sudo rpm -ivh courier-imap-4.2.1-1.8.i386.rpm |
||
+ | </PRE> |
||
⚫ | |||
− | |||
⚫ | |||
Now we go back to our downloads directory: |
Now we go back to our downloads directory: |
||
+ | <PRE> |
||
− | |||
cd $HOME/downloads |
cd $HOME/downloads |
||
+ | </PRE> |
||
− | |||
and run rpmbuild again: |
and run rpmbuild again: |
||
+ | <PRE> |
||
sudo rpmbuild -ta maildrop-2.0.4.tar.bz2 |
sudo rpmbuild -ta maildrop-2.0.4.tar.bz2 |
||
+ | </PRE> |
||
− | |||
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system): |
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system): |
||
+ | <PRE> |
||
− | |||
cd $HOME/rpm/RPMS/i386 |
cd $HOME/rpm/RPMS/i386 |
||
+ | </PRE> |
||
− | |||
The command |
The command |
||
+ | <PRE> |
||
− | |||
ls -l |
ls -l |
||
+ | </PRE> |
||
− | |||
shows you the available rpm packages: |
shows you the available rpm packages: |
||
+ | <PRE> |
||
− | |||
[falko@server1 i386]$ ls -l |
[falko@server1 i386]$ ls -l |
||
total 3128 |
total 3128 |
||
Строка 183: | Строка 194: | ||
-rw-r--r-- 1 root root 58439 2007-11-13 18:35 maildrop-man-2.0.4-1.8.i386.rpm |
-rw-r--r-- 1 root root 58439 2007-11-13 18:35 maildrop-man-2.0.4-1.8.i386.rpm |
||
[falko@server1 i386]$ |
[falko@server1 i386]$ |
||
+ | </PRE> |
||
− | |||
You can now install maildrop like this: |
You can now install maildrop like this: |
||
+ | <PRE> |
||
− | |||
sudo rpm -ivh maildrop-2.0.4-1.8.i386.rpm |
sudo rpm -ivh maildrop-2.0.4-1.8.i386.rpm |
||
+ | </PRE> |
||
− | |||
After you have compiled and installed all needed packages, you can become root again by typing |
After you have compiled and installed all needed packages, you can become root again by typing |
||
Текущая версия на 15:42, 28 сентября 2012
Courier-Imap
Это копия статьи как сбилдить курьера для CentOs"
For some reason there are no Courier packages (courier-imap, courier-authlib, maildrop) available on RedHat-based distributions (RedHat, Fedora, CentOS), and the only third-party repository that had such packages seems to have closed (enlartenment.com). Therefore this tutorial explains how you can create and install your own Courier rpm packages from the sources, and I provide download links for my Courier rpm packages that I compiled on Fedora 8 (i386) so that you can save some time.
I do not issue any guarantee that this will work for you!
Preliminary Note
I have tried this on a Fedora 8 (i386) system; it should work for RedHat and CentOS as well. If you are on an x86_64 system, replace all references to i386 in this tutorial with x86_64.
- Installing Prerequisites
Before we can compile the Courier packages, we need some prerequisites such as compilers, development libraries, etc. which we can install like this:
yum groupinstall 'Development Tools' yum groupinstall 'Development Libraries' yum install rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig zlib-devel pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel
Creating A Non-Priviledged User Account
RPM packages should not be built as root; courier-imap will even refuse to compile if it detects that the compilation is run as the root user. Therefore we create a normal user account now (falko in this example) and give him a password:
useradd -m -s /bin/bash falko passwd falko
We will need the sudo command later on so that the user falko can compile and install the rpm packages. But first, we must allow falko to run all commands using sudo:
Run
visudo
In the file that opens there's a line root ALL=(ALL) ALL. Add a similar line for falko just below that line:
[...] ## Allow root to run any commands anywhere root ALL=(ALL) ALL falko ALL=(ALL) ALL [...]
Building courier-authlib, courier-imap, And maildrop
Now we are ready to build our rpm package. First become the user falko:
su falko
Next we create our build environment:
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
Now we create a downloads directory and download the source files from http://www.courier-mta.org/download.php:
mkdir $HOME/downloads cd $HOME/downloads
Тут - внимательно надо найти текущюю версию.
wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.60.2.tar.bz2 wget http://prdownloads.sourceforge.net/courier/courier-imap-4.2.1.tar.bz2 wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2
courier-authlib
Now (still in $HOME/downloads) we can build courier-authlib:
sudo rpmbuild -ta courier-authlib-0.60.2.tar.bz2
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system):
cd $HOME/rpm/RPMS/i386
The command
ls -l
shows you the available rpm packages:
[falko@server1 i386]$ ls -l total 600 -rw-r--r-- 1 root root 137335 2007-11-13 18:02 courier-authlib-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 323827 2007-11-13 18:02 courier-authlib-debuginfo-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 34201 2007-11-13 18:02 courier-authlib-devel-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 18039 2007-11-13 18:02 courier-authlib-ldap-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 14258 2007-11-13 18:02 courier-authlib-mysql-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 13602 2007-11-13 18:02 courier-authlib-pgsql-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 8336 2007-11-13 18:02 courier-authlib-pipe-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 36859 2007-11-13 18:02 courier-authlib-userdb-0.60.2-1.fc8.i386.rpm [falko@server1 i386]$
Select the ones you want to install, and install them like this:
sudo rpm -ivh courier-authlib-0.60.2-1.fc8.i386.rpm sudo rpm -ivh courier-authlib-devel-0.60.2-1.fc8.i386.rpm sudo rpm -ivh courier-authlib-mysql-0.60.2-1.fc8.i386.rpm
courier-imap
Now we go back to our downloads directory:
cd $HOME/downloads
and run rpmbuild again, this time without sudo, otherwise the compilation will fail because it was run as root:
rpmbuild -ta courier-imap-4.2.1.tar.bz2
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system):
cd $HOME/rpm/RPMS/i386
The command
ls -l
shows you the available rpm packages:
[falko@server1 i386]$ ls -l total 1284 -rw-r--r-- 1 root root 137335 2007-11-13 18:02 courier-authlib-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 323827 2007-11-13 18:02 courier-authlib-debuginfo-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 34201 2007-11-13 18:02 courier-authlib-devel-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 18039 2007-11-13 18:02 courier-authlib-ldap-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 14258 2007-11-13 18:02 courier-authlib-mysql-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 13602 2007-11-13 18:02 courier-authlib-pgsql-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 8336 2007-11-13 18:02 courier-authlib-pipe-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 36859 2007-11-13 18:02 courier-authlib-userdb-0.60.2-1.fc8.i386.rpm -rw-rw-r-- 1 falko falko 383455 2007-11-13 18:21 courier-imap-4.2.1-1.8.i386.rpm -rw-rw-r-- 1 falko falko 917771 2007-11-13 18:21 courier-imap-debuginfo-4.2.1-1.8.i386.rpm [falko@server1 i386]$
You can install courier-imap like this:
sudo rpm -ivh courier-imap-4.2.1-1.8.i386.rpm
maildrop
Now we go back to our downloads directory:
cd $HOME/downloads
and run rpmbuild again:
sudo rpmbuild -ta maildrop-2.0.4.tar.bz2
After the build process, the rpm packages can be found in $HOME/rpm/RPMS/i386 ($HOME/rpm/RPMS/x86_64 if you are on an x86_64 system):
cd $HOME/rpm/RPMS/i386
The command
ls -l
shows you the available rpm packages:
[falko@server1 i386]$ ls -l total 3128 -rw-r--r-- 1 root root 137343 2007-11-13 18:02 courier-authlib-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 324618 2007-11-13 18:02 courier-authlib-debuginfo-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 34208 2007-11-13 18:02 courier-authlib-devel-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 18042 2007-11-13 18:02 courier-authlib-ldap-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 14254 2007-11-13 18:02 courier-authlib-mysql-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 13599 2007-11-13 18:02 courier-authlib-pgsql-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 8339 2007-11-13 18:02 courier-authlib-pipe-0.60.2-1.fc8.i386.rpm -rw-r--r-- 1 root root 36855 2007-11-13 18:02 courier-authlib-userdb-0.60.2-1.fc8.i386.rpm -rw-rw-r-- 1 falko falko 383455 2007-11-13 18:21 courier-imap-4.2.1-1.8.i386.rpm -rw-rw-r-- 1 falko falko 917771 2007-11-13 18:21 courier-imap-debuginfo-4.2.1-1.8.i386.rpm -rw-r--r-- 1 root root 299030 2007-11-13 18:35 maildrop-2.0.4-1.8.i386.rpm -rw-r--r-- 1 root root 752872 2007-11-13 18:35 maildrop-debuginfo-2.0.4-1.8.i386.rpm -rw-r--r-- 1 root root 136235 2007-11-13 18:35 maildrop-devel-2.0.4-1.8.i386.rpm -rw-r--r-- 1 root root 58439 2007-11-13 18:35 maildrop-man-2.0.4-1.8.i386.rpm [falko@server1 i386]$
You can now install maildrop like this:
sudo rpm -ivh maildrop-2.0.4-1.8.i386.rpm
After you have compiled and installed all needed packages, you can become root again by typing
exit