Monday, January 14, 2013

iRedMail on CentOS release 6.2 (Final)

DOwnload the latest release of iRedMail here
wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.8.3.tar.bz2
Extract download result using command below
tar -jxvf iRedMail-0.8.3.tar.bz2
After extract finished, go to extract result directory
cd iRedMail-0.8.3
Run iRedMail-0.8.3.sh script
$ sh iRedMail.sh 
< INFO > Checking new version of iRedMail ...
< INFO > Clean metadata of yum repositories.
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base c6-media epel extras updates
20 metadata files removed
8 sqlite files removed
0 metadata files removed
< INFO > Generating yum repository ...
< INFO > Fetching source tarballs ...
< INFO > + 1 of 6: http://iredmail.org/yum/misc/iRedAdmin-0.2.tar.bz2
< INFO > + 2 of 6: http://iredmail.org/yum/misc/roundcubemail-0.8.2.tar.gz
< INFO > + 3 of 6: http://iredmail.org/yum/misc/phpldapadmin-1.2.2.tgz
< INFO > + 4 of 6: http://iredmail.org/yum/misc/phpMyAdmin-3.5.3-all-languages.tar.bz2
< INFO > + 5 of 6: http://iredmail.org/yum/misc/iRedAPD-1.3.8.tar.bz2
< INFO > + 6 of 6: http://iredmail.org/yum/misc/phpPgAdmin-5.0.4.tar.bz2
< INFO > Validate packages ... [ OK ]
< INFO > Install package: dialog
< INFO > Installing package(s): dialog
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
.....
...











After this step, iRedMail instalation will be update all your repo's database, to make sure you get the latest realease of the files. after update all repo's database, it will continue with downloading required packages and install it. You just need to relax and wait ( and hope have fast internet connection ), becasue in my case, it will install ( including update) 80 package.
Complete!




********************************************************************
* Start iRedMail Configurations
********************************************************************
< INFO > Create SSL certification files.
< INFO > Create required system accounts: vmail, iredapd, iredadmin.
< INFO > Configure Apache web server and PHP.
< INFO > Configure PostgreSQL database server.
< INFO > Configure Postfix (Message Transfer Agent).
< INFO > Configure Policyd (postfix policy server, code name cluebringer).
< INFO > Configure Dovecot (pop3/imap/managesieve server, version 2).
< INFO > Configure ClamAV (anti-virus toolkit).
< INFO > Configure Amavisd-new (interface between MTA and content checkers).
< INFO > Configure SpamAssassin (content-based spam filter).
< INFO > Configure iRedAPD (postfix policy daemon).
< INFO > Configure iRedAdmin (official web-based admin panel).
< INFO > Configure Fail2ban (authentication failure monitor).
< INFO > Configure Awstats (logfile analyzer for mail and web server).
< INFO > Configure Roundcube webmail.
< INFO > Configure phpPgAdmin (web-based PostgreSQL management tool).

*************************************************************************
* iRedMail-0.8.3 installation and configuration complete.
*************************************************************************

< INFO > Disable SELinux in /etc/selinux/config.
< Question > Would you like to use firewall rules provided by iRedMail now?
< Question > File: /etc/sysconfig/iptables, with SSHD port: 22. [Y|n] n
and then iRedMail will try to update your ClamAv Database, after installation finish, you will get this notification.
********************************************************************
* URLs of installed web applications:
*
* - Webmail: httpS://merkurius.anekarupatera.lan/mail/
* - Admin Panel (iRedAdmin): httpS://merkurius.anekarupatera.lan/iredadmin/
*   + Username: postmaster@anekarupatera.lan, Password: ********
*

********************************************************************
* Congratulations, mail server setup complete. Please refer to tip
* file for more information:
*
*   - /tmp/iRedMail-0.8.3/iRedMail.tips
*
* And it's sent to your mail account postmaster@anekarupatera.lan.
*
* Please reboot your system to enable mail services.
*
********************************************************************
Important, first you must read the /tmp/iRedMail-0.8.3/iRedMail.tips, on the first installation I've not read it at all, but after got some trouble i came back to read it :D
$ cat /tmp/iRedMail-0.8.3/iRedMail.tips
Finish ??? Not Yet We must update bind configuration with Domain Keys Indentified Main (DKIM), now open your console again.
$ amavisd show keys
Or, if the above command complain about config file, "Config file "/etc/amavisd.conf" does not exist, at /usr/sbin/amavisd line 1799." you can use command below.
$ amavisd -c /etc/amavisd/amavisd.conf showkeys
In my case, the output loook like this
$ amavisd -c /etc/amavisd/amavisd.conf showkeys
; key#1, domain anekarupatera.lan, /var/lib/dkim/anekarupatera.lan.pem
dkim._domainkey.anekarupatera.lan. 3600 TXT (
  "v=DKIM1; p="
  "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkfeQwd0g+DmQf4PE0vwtO3sJV"
  "pGgLrq1g5Uw0/erPxL8DGj2IdviHQuA364CpOvB4jA4h9U/fJiGBsWNA0SjnLTjV"
  "yLM4iNOSCPISJKnnvcnG6vv4UXDjwYoDJd5JYNbW2tURNMDQeWNdfQ4thLygtPH8"
  "3hkpL1b9EV5Xf9ldAwIDAQAB")
Copy and paste output text to your bind configuration in ONE LINE !!!, make it like this
$ cat /var/named/anekarupatera.lan

$ORIGIN anekarupatera.lan.
$ttl 86400
@       IN      SOA     nebula.anekarupatera.lan. root.anekarupatera.lan. (
                        2009101590
                        43200
                        3600
                        1209600
                        604800 )

                IN      NS                      nebula.anekarupatera.lan.

                IN      MX      10              nebula.anekarupatera.lan.

aurora          IN      A       192.168.110.74
athena          IN      A       192.168.110.200
gaia            IN      A       192.168.110.230
chronos         IN      A       192.168.110.231
porteus         IN      A       192.168.110.232
samba           IN      A       192.168.110.253
nebula          IN      A       192.168.110.254

mail            IN      CNAME   nebula
www             IN      CNAME   nebula

dkim._domainkey.anekarupatera.lan. IN TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkfeQwd0g+DmQf4PE0vwtO3sJVpGgLrq1g5Uw0/erPxL8DGj2IdviHQuA364CpOvB4jA4h9U/fJiGBsWNA0SjnLTjVyLM4iNOSCPISJKnnvcnG6vv4UXDjwYoDJd5JYNbW2tURNMDQeWNdfQ4thLygtPH83hkpL1b9EV5Xf9ldAwIDAQAB"
Now test your DKIM key, it should be pass right now.
# amavisd -c /etc/amavisd/amavisd.conf testkeys
TESTING#1: dkim._domainkey.anekarupatera.lan => pass
Final check, Make sure you have /var/www/awstats/awstats.pl on /var/www/awstats/ directory, if you don't have it, you must create it using command below.
ln /usr/share/awstats/wwwroot/cgi-bin/awstats.pl  /var/www/awstats/awstats.pl
Now reboot your linux.

After Reboot :

READ your iRedMail.tips


No comments: