Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Hello, I'm a new user of ML Server and I'd like to know how I can install a webmail such as Roundcube.

Roundcube is no longer supported by default in Mountain Lion Server, but I wanted to install a modern webmail anyway. Comments on SQL configuration would be particularly appreciated. Thanks!

Mountain Lion Server-OTHER, OS X Server

Posted on Aug 4, 2012 2:36 AM

Reply
26 replies

Aug 4, 2012 9:22 AM in response to magicalexis75

I've installed the 0.8RC of RoundCube onto a new Mac Mini Server with 10.8/server.


The SQL config was simple, just follow the INSTALL instructions.


I prefer Postgres, and it is installed with ML, but currently appears to have a problem, so use MySQL. Issue with Postgres appears to be database is configured with different field lengths than the app is producing.

Aug 8, 2012 2:35 AM in response to Carl Muckenhirn

What problems did you see with PostgreSQL and RoundCube? I just set up RoundCube 0.8.0 with PostgreSQL on a test system and it seems to be working. At least it's working for my one user sending a couple of emails to himself. I created my test database and user with:


sudo -u _postgres psql postgres -c "create database roundcubemail_db"

sudo -u _postgres psql postgres -c "create user roundcubemail_user with password 'blahblah'"

sudo -u _postgres psql postgres -c "grant all privileges on database roundcubemail_db to roundcubemail_user"


The rest of the configuration was mostly straightforward.


There was one part that was not so easy, though. It might not be necessary in all cases, or maybe it was because I misconfigured something somewhere, but in order to log into RoundCube, I had to configure mail to allow plain text logins and RoundCube to also log in with plain text. Even though the web server itself is HTTPS and the web server and mail server are the same system, l wouldn't be comfortable leaving it configured this way on a production server. The default CRAM-MD5 method was being used by RoundCube and even though it was enabled in dovecot, authentication was failing. I didn't see the option to set plain text login in RoundCube's installer webpages, so I had to manually edit it in config/main.inc.php:


$rcmail_config['imap_auth_type'] = PLAIN;

Sep 1, 2012 11:32 AM in response to magicalexis75

You need to change the main.inc.php file in the config directory to allow the installer to run by changing $rcmail_config['enable_installer'] = false to $rcmail_config['enable_installer'] = true


Also you need to put the webmail folder somewhere within your /Library/Server/Web/Data/Sites/Default folder if you have not made a seperate site for your webmail in Server.app.

Sep 3, 2012 7:30 AM in response to Mark23

OK, now I have two problems:


The first is that I need to grant write privileges to the webserver for temp/ and logs/. I don't know which command to use and how. The following is what appears on the php installer:


Check if directories are writable

Roundcube may need to write/save files into these directories

temp/: NOT OK(not writeable for the webserver)

logs/: NOT OK(not writeable for the webserver)

Use chmod or chown to grant write privileges to the webserver


The second problem concerns the mail server. I don't really know how I can get a working imap and smtp. For info, my domain is cervoni.info, my hostname (FQDN) is mail.cervoni.info. On my dns service, I have both an A and MX record for mail.cervoni.info.


How I can get mail for a user (with the right logins), say the admin for instance, is what I don't understand.


Thanks for your help.

Sep 3, 2012 8:14 AM in response to magicalexis75

For the not OK messages, please open up terminal and enter the following:


sudo chown -R _www temp

sudo chown -R _www logs


You need to grant access to the users that are supposed to be mail enabled in the server.app by right clicking the user name in the Users section and choosing the Edit access to services... dropdown menu item and then marking Mail as selected.


IMAP and SMTP will start when you've switched the Mail server to ON, simple... You just need to enable port forwarding on your router for TCP ports 25 for SMTP, 143 for IMAP or 933 for Secure IMAP and port 587 (Submission) so your external users can deliver mail to be forwarded to another domain.


For secure IMAP you need to have an SSL certificate set and maybe your ISP has port 25 blocked, which would mean maybe your ISP has a relay host that you can use, which you then need to set in server.app by checking the option Relay mail... In that case you need to specify the outgoing relay server next to it. On the other hand you would then need to specify the incomming mail relay host in your DNS with a bigger preference than your own mail server, like so:


Name Preference Server

@ 10 yourserver.domain.com

@ 20 relayhost.isp.com

Sep 7, 2012 11:35 AM in response to Mark23

Hello Mark23,


Thanks for your last comment, that was really helpful. The problem I have now concerns the database. I created a database on Postgresql as indicated by Blaidd Drwg:


sudo -u _postgres psql postgres -c "create database roundcubemail_db"

sudo -u _postgres psql postgres -c "create user roundcubemail_user with password 'blahblah'"

sudo -u _postgres psql postgres -c "grant all privileges on database roundcubemail_db to roundcubemail_user"


My database name is "roundcubemail", the user "valturi" and password "xxxx". I don't really know how to get a working database. Here is the error message:


Check DB config

DSN (write): NOT OK(MDB2 Error: connect failed)

Make sure that the configured database exists and that the user has write privileges
DSN: pgsql://valturi:xxxx@localhost/roundcubemail


Would it be better to use MySQL? Can I use "localhost" as the host?


Thanks for your help!


Alexandre

Sep 7, 2012 11:46 AM in response to magicalexis75

This is how to set up the database in PostgreSQL:


To use Roundcube with PostgreSQL support you have to follow these

simple steps, which have to be done as the postgres system user (or

which ever is the database superuser):

$ createuser roundcube

$ createdb -O roundcube -E UNICODE roundcubemail

$ psql roundcubemail



roundcubemail =# ALTER USER roundcube WITH PASSWORD 'the_new_password';

roundcubemail =# \c - roundcube

roundcubemail => \i SQL/postgres.initial.sql


After that please update your main.inc.php file through the installer by place the resulting file in the config directory.

Hello, I'm a new user of ML Server and I'd like to know how I can install a webmail such as Roundcube.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.