SOGo CentOS iRedMail HOWTO

SOGo is a great open source Group-Ware solution for nearly all clients and devices. It's fully LDAP, CardDAV, CalDAV and WebDAV compatible and the best solotion for an iPhone + iPad + Mac server based sync. if you don't trust cloud services and don't want to use Apple applications only, this is what you'll need.

iRedMail is easy to install mail server solution based on well known components like Postfix, Dovecot, SpamAssassin, Amavisd, ClamAV, MySQL and OpenLDAP. With that setup you have the best base to setup SOGo as your Web front-end and Group-Ware.

This HOWTO is based on a CentOS 5.4 vServer installation, iRedMail package 0.6.1 and SOGo 1.3.10.

CentOS

There are a lot of HOWTOs to setup a secure CentOS webserver. I don't want to get into this deeper here.

iRedMail

Set your hostname in /etc/sysconfig/network

HOSTNAME=yourdomain.net

also in /etc/hosts

127.0.0.1   yourdomain.net mail localhost localhost.localdomain

get the install package

wget http://iredmail.googlecode.com/files/iRedMail-0.6.1.tar.bz2

untar it

tar xjf iRedMail-0.6.1.tar.bz2 

get all dependencies

cd iRedMail-0.6.1/pkgs/
bash get_all.sh

start your installation

cd ..
bash iRedMail.sh

go through the setup dialogs

	openldap backend
	dc=yourdomain,dc=net
	cn=Manager,dc=yourdomain,dc=net Password: secret
	MySQL admin root Password: secret
	virtual domain name: yourdomain.net
	postmaster@yourdomain.net Password: secret
	first user webmail Password www@yourdomain.net: secret
	root user alias: www@yourdomain.net
	
	Roundcube webmail http://your_server/mail/ (or /webmail, /roundcube) YES YES 
	SquirrelMail webmail http://your_server/squirrelmail/ (or /squirrel) YES YES 
	phpMyAdmin https://your_server/phpmyadmin/ (or /mysql) NO YES 
	phpLDAPAdmin https://your_server/ldap/ (or /phpldapadmin) NO YES 
	Awstats https://your_server/awstats/awstats.pl NO YES
	iRedAdmin https://your_server/iredadmin NO YES

thats it. Go and test your new mail server, if all is running well go ahead and install SOGo.

SOGo

Add the SOGo repository to yum

vi /etc/yum.repos.d/SOGo.repo

and add the following lines

	[sogo-Centos5]
	name=Inverse SOGo Repository
	baseurl=http://inverse.ca/downloads/SOGo/CentOS5/$basearch
	enabled=1
	gpgcheck=0

start the installation

yum clean all
yum list
yum install sogo
yum install sope49-gdl1-mysql

login into mysql

mysql -p

and create the SOGo mysql database

	create database sogo;
	grant all on sogo.* to sogo@localhost identified by "secret";
	flush privileges;
	quit

create the SOGO (GNUstep) config file

vi /home/sogo/GNUstep/Defaults/.GNUstepDefaults

and set it up with your needs

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//GNUstep//DTD plist 0.9//EN" "http://www.gnustep.org/plist-0_9.xml">
<plist version="0.9">
<dict>
    <key>NSGlobalDomain</key>
    <dict>
    </dict>
    <key>gdnc</key>
    <dict>
    </dict>
    <key>sogod</key>
    <dict>
	<key>#GCSFolderDebugEnabled</key>
	<string>YES</string>
	<key>#GCSFolderStoreDebugEnabled</key>
	<string>YES</string>
	<key>#NGImap4DisableIMAP4Pooling</key>
	<string>YES</string>
	<key>#OCSFolderManagerSQLDebugEnabled</key>
	<string>YES</string>
	<key>#PGDebugEnabled</key>
	<string>YES</string>
	<key>#SoSecurityManagerDebugEnabled</key>
	<string>YES</string>
	<key>#WOApplicationRedirectURL</key>
	<string>https://yourdomain.net</string>
	<key>NGImap4DisableIMAP4Pooling</key>
	<string>YES</string>
	<key>NGUseUTF8AsURLEncoding</key>
	<string>YES</string>
	<key>OCSFolderInfoURL</key>
	<string>mysql://sogo:secret@localhost:3306/sogo/sogo_folder_info</string>
	<key>SOGoACLsSendEMailNotifications</key>
	<string>YES</string>
	<key>SOGoAppointmentSendEMailNotifications</key>
	<string>YES</string>
	<key>SOGoAuthenticationMethod</key>
	<string>LDAP</string>
	<key>SOGoDefaultCalendar</key>
	<string>selected</string>
	<key>SOGoFoldersSendEMailNotifications</key>
	<string>YES</string>
	<key>SOGoIMAPServer</key>
	<string>localhost</string>
	<key>SOGoLanguage</key>
	<string>English</string>
	<key>SOGoMailDomain</key>
	<string>yourdomain.net</string>
	<key>SOGoMailingMechanism</key>
	<string>sendmail</string>
	<key>SOGoProfileURL</key>
	<string>mysql://sogo:secret@localhost:3306/sogo/sogo_user_profile</string>
	<key>SOGoSieveScriptsEnabled</key>
	<string>YES</string>
	<key>SOGoSieveServer</key>
	<string>sieve://localhost</string>
	<key>SOGoSuperUsernames</key>
	<array>
	    <string>www</string>
	</array>
	<key>SOGoTimeZone</key>
	<string>Europe/Berlin</string>
	<key>SOGoUserSources</key>
	<array>
	    <dict>
		<key>CNFieldName</key>
		<string>cn</string>
		<key>IDFieldName</key>
		<string>mail</string>
		<key>UIDFieldName</key>
		<string>uid</string>
		<key>baseDN</key>
		<string>o=domains,dc=yourdomain.net,dc=net</string>
		<key>bindDN</key>
		<string>cn=Manager,dc=yourdomain,dc=net</string>
		<key>bindFields</key>
		<string>cn</string>
		<key>bindPassword</key>
		<string>secret</string>
		<key>canAuthenticate</key>
		<string>YES</string>
		<key>displayName</key>
		<string>Shared Address Book</string>
		<key>hostname</key>
		<string>127.0.0.1</string>
		<key>id</key>
		<string>public</string>
		<key>isAddressBook</key>
		<string>YES</string>
		<key>port</key>
		<string>389</string>
		<key>scope</key>
		<string>sub</string>
	    </dict>
	</array>
	<key>SOGoVacationEnabled</key>
	<string>YES</string>
	<key>WOMessageUseUTF8</key>
	<string>YES</string>
	<key>WOParsersUseUTF8</key>
	<string>YES</string>
	<key>WOPort</key>
	<string>20000</string>
	<key>WOUseRelativeURLs</key>
	<string>YES</string>
	<key>debug</key>
	<string>yes</string>
    </dict>
</dict>

start the deamons

service memcached start
service sogod start
service httpd restart

that's it. Check your log files and try to login http://yourdomain.net/SOGo

To setup your clients and tweak your install, have a look here.

Enter your comment. Wiki syntax is allowed:
   ___    ___    _  __   ___    _  __
  / _ \  / _ \  | |/_/  / _ |  | |/_/
 / // / / ___/ _>  <   / __ | _>  <  
/____/ /_/    /_/|_|  /_/ |_|/_/|_|