RoundCube Webmail With PostgreSQL, Mcrypt, Authentication Fixes
I installed roundcube wemail and found that I had to add a lot of functionality and fixes along the way. Here's the terse step-by-step and my notes:
Loosely based on this.
# get roundcube
sudo mkdir -p /usr/share/web
(cd /usr/share/web ; sudo tar xfz ~/Downloads/roundcubemail-0.8.2.tar.gz )
sudo ln -s /usr/share/web/roundcubemail-0.8.2 /usr/share/web/roundcubemail
# create postgres roundcube user, roundcubemail db
sudo createuser -U _postgres -P roundcube
sudo createdb -U _postgres -O roundcube -E UNICODE -W roundcubemail
# Don't do this! -- the installer will take care of this
# sudo psql -q -d roundcubemail roundcube --password
# \c – roundcube
# \i SQL/postgres.initial.sql
# \q
sudo mkdir sudo vi /Library/Server/Web/Config/apache2/domainnam
sudo vi /Library/Server/Web/Config/apache2/domainname/roundcubemail.conf
Alias /webmail "/usr/share/web/roundcubemail"
<Directory "/usr/share/web/roundcubemail">
DirectoryIndex index.php
</Directory>
sudo vi /Library/Server/Web/Config/apache2/httpd_server_app.conf
Include /Library/Server/Web/Config/apache2/domainname/*.conf
(at the end)
# Install mcrypt php module
# See http://michaelgracie.com/2012/09/26/plugging-mcrypt-into-php-on-mac-os-x-mountai n-lion-10-8/
Xcode>Open Developer Tool>More Developer Tools...
sudo port install autoconf
# install mcrypt and intl
cd ~/Downloads/libmcrypt-2.5.8
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking
make -j6
sudo make install
cd ~/Downloads/php-5.3.15/ext/mcrypt/
/usr/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.8 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/usr/bin/php-config
make -j6
make test
sudo make install
cd ~/Downloads/php-5.3.15/ext/intl/
/usr/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.8 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/usr/bin/php-config
make -j6
make test
sudo make install
sudo vi /etc/php.ini
extension=mcrypt.so
extension=intl.so
Sever.app>Stop and Start Web
Safari>https://domainname.com/webmail/installer
Specify postgres as the database in the installer.
# Fix installer/index.php
cd /usr/share/web/roundcubemail
sudo patch -p0 < ~/Downloads/changeset_d13f3293eaacd1263f620971d9304dbf2786a0dc.diff
cd /usr/share/web/roundcubemail/config
sudo chmod go-r db.inc.php main.inc.php
sudo chown www:www db.inc.php main.inc.php
sudo vi main.inc.php
$rcmail_config['default_host'] = 'ssl://server.domainname.com';
$rcmail_config['default_port'] = 993;
$rcmail_config['imap_auth_type'] = 'CRAM-MD5';
$rcmail_config['smtp_server'] = 'tls://smtp.domainname.com';
$rcmail_config['smtp_port'] = 587;
# Logs always show a FAIL on DIGEST-MD5 authentication:
Nov 2 20:33:44 domainname.com log[249]: auth: Error: od(username,10.0.1.3): authentication failed for user=username, method=DIGEST-MD5
So I just turned off DIGEST-MD5 authentication in serveradmin and it worked.
sudo serveradmin settings mail:imap:imap_auth_digest_md5 = no
# Provide link to web mail on Server main page
cd /Library/Server/Web/Data/Sites/Default
sudo cp default.html.en default.html.en.orig
sudo vi default.html.en
<a href="/webmail" title="Mail">Mail</a> |
<a href="/webcal" title="Calendar">Calendar</a> |
# Clean up
cd /usr/share/web/roundcubemail
sudo chmod go-rwx ./install
Mac mini Server (Mid 2010), OS X Mountain Lion (10.8.2), Lion Server, EyeTV HD, Turbo.264 HD