The Perfect Server - CentOS 5.3 x86_64 [ISPConfig 3] - Page 4
10 Install Courier-IMAP, Courier-Authlib, And MaildropUnfortunately there are no rpm packages for Courier-IMAP, Courier-Authlib, and Maildrop, therefore we have to build them ourselves. 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 (compileuser in this example) and give him a password: useradd -m -s /bin/bash compileuser We will need the sudo command later on so that the user compileuser can compile and install the rpm packages. But first, we must allow compileuser 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 compileuser just below that line:
Now we are ready to build our rpm package. First become the user compileuser: su compileuser Next we create our build environment: mkdir $HOME/rpm echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros Now we download the source files from http://www.courier-mta.org/download.php: cd /tmp Now (still in /tmp) we can build courier-authlib: sudo rpmbuild -ta courier-authlib-0.62.2.tar.bz2 After the build process, the rpm packages can be found in $HOME/rpm/RPMS/x86_64 ($HOME/rpm/RPMS/i386 if you are on an i386 system): cd $HOME/rpm/RPMS/x86_64 The command ls -l shows you the available rpm packages: [compileuser@server1 x86_64]$ ls -l Select the ones you want to install, and install them like this: sudo rpm -ivh courier-authlib-0.62.2-1.x86_64.rpm courier-authlib-mysql-0.62.2-1.x86_64.rpm courier-authlib-devel-0.62.2-1.x86_64.rpm Now we go back to the /tmp directory and run rpmbuild again, this time without sudo, otherwise the compilation will fail because it was run as root: cd /tmp After the build process, the rpm packages can be found in $HOME/rpm/RPMS/x86_64 ($HOME/rpm/RPMS/i386 if you are on an i386 system): cd $HOME/rpm/RPMS/x86_64 The command ls -l shows you the available rpm packages: [compileuser@server1 x86_64]$ ls -l You can install courier-imap like this: sudo rpm -ivh courier-imap-4.5.0-3.x86_64.rpm Now we go back to the /tmp directory and run rpmbuild again, this time to build a maildrop package: cd /tmp After the build process, the rpm packages can be found in $HOME/rpm/RPMS/x86_64 ($HOME/rpm/RPMS/i386 if you are on an i386 system): cd $HOME/rpm/RPMS/x86_64 The command ls -l shows you the available rpm packages: [compileuser@server1 x86_64]$ ls -l You can now install maildrop like this: sudo rpm -ivh maildrop-2.1.0-3.x86_64.rpm After you have compiled and installed all needed packages, you can become root again by typing exit
11 Apply Quota Patch To PostfixWe have to get the Postfix source rpm, patch it with the quota patch, build a new Postfix rpm package and install it. cd /usr/src The last command will show some warnings that you can ignore: warning: user mockbuild does not exist - using root cd /usr/src/redhat/SOURCES Now we must edit the file postfix.spec: vi postfix.spec Change %define MYSQL 0 to %define MYSQL 1, add Patch0: postfix-2.3.3-vda.patch to the # Patches stanza, and finally add %patch0 -p1 -b .vda to the %setup -q stanza:
Then we build our new Postfix rpm package with quota and MySQL support: rpmbuild -ba postfix.spec Our Postfix rpm package is created in /usr/src/redhat/RPMS/x86_64 (/usr/src/redhat/RPMS/i386 if you are on an i386 system), so we go there: cd /usr/src/redhat/RPMS/x86_64 The command ls -l shows you the available packages: [root@server1 x86_64]# ls -l Pick the Postfix package and install it like this: rpm -ivh postfix-2.3.3-2.1.x86_64.rpm Then turn off Sendmail and start Postfix, saslauthd, and courier-authlib: chkconfig --levels 235 courier-authlib on chkconfig --levels 235 sendmail off
12 Configure CourierNow we create the system startup links for courier-imap: chkconfig --levels 235 courier-imap on When courier-imap is started for the first time, it automatically creates the certificate files /usr/lib/courier-imap/share/imapd.pem and /usr/lib/courier-imap/share/pop3d.pem from the /usr/lib/courier-imap/etc/imapd.cnf and /usr/lib/courier-imap/etc/pop3d.cnf files. Because the .cnf files contain the line CN=localhost, but our server is named server1.example.com, the certificates might cause problems when you use TLS connections. To solve this, we delete both certificates... cd /usr/lib/courier-imap/share/ ... and replace the CN=localhost lines in /usr/lib/courier-imap/etc/imapd.cnf and /usr/lib/courier-imap/etc/pop3d.cnf with CN=server1.example.com: vi /usr/lib/courier-imap/etc/imapd.cnf
vi /usr/lib/courier-imap/etc/pop3d.cnf
Then we recreate both certificates... ./mkimapdcert ... and restart courier-authlib and courier-imap: /etc/init.d/courier-authlib restart
13 Install GetmailGetmail can be installed as follows: yum install getmail
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com
Red Hat Virtual Experience - a free virtual event. Dec. 9th





print: 
Recent comments
3 hours 14 min ago
9 hours 3 min ago
10 hours 54 min ago
12 hours 39 min ago
16 hours 29 min ago
22 hours 14 min ago
22 hours 25 min ago
1 day 2 hours ago
1 day 8 hours ago
1 day 13 hours ago