Richard
To allow you and your users to access their email from anywhere you can install this webmail client Roundcube. It’s a very user friendly and usable web based mail program, it’s got some ajax goodness and will allow for instance drag and drop mails into their IMAP folders. Please note that to fully benefit from a webmail client your users should use the IMAP capabilities of your server. Which means that all their email is stored on the server and stays accessible.
You need to download the latest code from the Roundcube site.
Extract the archive into the Document root of your Apache installation, in our case /Library/WebServer/Documents.
To be able to install new versions and to migrate easily we setup a symbolic link to the current roundcube directory which we can change when a new vrsion arrives.
Step into the newly created directory and change the permissions on the temp and logs directory so that the webserver can write into these directories with the following commands:
chown -R www:www logs
Next we need to create a database for Roundcube to use. Start up MySQL on the command line and issue the following commands in MySQL:
GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
IDENTIFIED BY ‘PASSWORD’;
FLUSH PRIVILEGES;
quit
Note: Change the PASSWORD into any password you would like to use, remember it as you need to put it in the configuration file later.
The next step is a lot simpeler since version 0.2 roundcube comes equiped with a proper installer. Point your browser to http://yourhostname/roundcubemail/installer/ and follow the instructions.
In step 2 you are asked some questions, these might be your answers to the important questions:
localhost
roundcubemail
roundcube
PASSWORD (the same as used above)
IMAP Settings:
ssl://localhost:993
The rest is up to your discretion.
If the installer was unable to create the config files you need to copy the contents located in the browser in the files db.inc.php and main.inc.php located in the directory config
If you’ve done all this your done with the configuration of Roundcube. If you have tested the setup and it works please remove the installer directory from the roundcube installation. It might be used by others to hack your installation.
I like to use a subdomains to divide up the specific tasks my webserver does. I use https://webmail.richard5.net to allow users to access their mail. How you can set this up as well is documented here.
If you’ve done that or just used a local directory to use, point your browser to http://webmail.yourdomain.tld or http://yourdomain.tld/roudcube and you should see a login screen appear.
For errors you could check the logfiles to explain what went wrong. For Roundcube errors check the /logs/errors file and for general mail errors check the /var/log/mail.log file.



Comments
11:40 am
Hi all.
I’ve just installed RoundCube following the instructions.
But when I try to login with username and pwd created in postfixadmin the mail.log gives me something like this:
Jun 16 12:38:57 zapytaj-gugla imapd[70]: Connection, ip=[::1]
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: received auth request, service=imap, authtype=login
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: authmysql: trying this module
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: authmysqllib: connected. Versions: header 50038, client 50038, server 50051
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: SQL query: SELECT username, crypt, password, ’102′, ’27′, ‘/usr/local/virtual’, maildir, “”, name, “” FROM mailbox WHERE username = ‘doc@zapytaj-gugla.com.pl’
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: mysql_query failed, reconnecting: Unknown column ‘crypt’ in ‘field list’
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: authmysqllib: connected. Versions: header 50038, client 50038, server 50051
Jun 16 12:38:57 zapytaj-gugla imapd[70]: LOGIN FAILED, user=doc@zapytaj-gugla.com.pl, ip=[::1]
Jun 16 12:38:57 zapytaj-gugla imapd[70]: authentication error: Input/output error
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: mysql_query failed second time, giving up: Unknown column ‘crypt’ in ‘field list’
Jun 16 12:38:57 zapytaj-gugla authdaemond[61]: authmysql: TEMPFAIL – no more modules will be tried
Can anybody help me with this one?
Best Regards,
zetbee
12:16 pm
There is an error in your query, please check your courier-auth config files!
6:04 pm
Hey all,
I have been following this really great tutorial from the start but have am kinda stumped at the Roundcube setup. I have installed everything and it’s working properly as far as I can tell, but I don’t have any users in the db to log in with. Roundcube doesn’t create the users, and postfix created a user in the postfix db, but from what I can tell, Roundcube uses the roundcubemail db (and I think it looks for users in /usr/local/virtual and there are no files in that directory.
Any help is appreciated!
Cheers,
David
9:48 am
David had made his postfix virtual config files unreadable for the postfix user. It is corrected and he has a fully finctional mailserver at the moment.
5:09 pm
A quick note for users that use Roundcube webmail as well as the mac mail client – Roundcube expects folder names of .Trash and .Sent for the trash and sent folders (In /usr/local/virtual/domain/user/). A user that uses the mac mail app will find that the defaults for that mail client create folders called “.Sent Messages” and “.Deleted Messages”. I fixed this problem by adding a quick sym link to .Trash and .Sent so roundcube could delete mail and use the same sent folder. Also once you create the links you need to change the ownership to _vmail:_postfix
6:36 am
Besides using symlinks, you can use the mail.app option to use dfferent folders for Junk, Trash, etc…
Fon instance, in Mail.app select the Sent folder, go to the Mailbox menu, select the option “Use this mailbox for” and select Sent. You can now delete the folder Sent Messages and the Send folder is used. It works the same on the iPhone and Touch.
1:42 am
A far more elegant solution. I looked for like an hour tying to find where I could set the folders. Thanks!
8:37 pm
Regarding the folders and Mail.app.
The config/main.inc.php hold information about foldernames. It might be easier to correct the config file than use symbolic links
9:14 pm
Hi Richard,
I think I am almost there, but I am stuck on the mail delivery. Here’s a brief summary:
1. Roundcube can send email through the test page and it can also see the IMAP server. Both authenticate correctly through mysql according to the mail log.
2. In the Roundcube user mail interface, there is only an INBOX and no email messages. If I add mail foders, they don’t show although in the folders tab I can see them. Enabling them on the folders tab doesn’t make a difference.
3. In the /usr/local/virtual/ I can see the folders, but they are on the root of the directory. I was under the impression that it would create a folder within and dump all the mail items in there. Here is the terminal print (my user name is “el”):MacMini:virtual el$ sudo ls -l -a
Password:
total 0
drwxrwx–x 3 _vmail _postfix 102 Dec 18 11:37 .
drwxr-xr-x 16 root wheel 544 Dec 18 01:04 ..
drwx—— 9 _vmail _postfix 306 Dec 18 11:37 .test-rename
MacMini:virtual el$ pwd
/usr/local/virtual
MacMini:virtual el$ mail
Mail version 8.1 6/6/93. Type ? for help.
“/var/mail/el”: 7 messages 7 unread
>U 1 el@tachin.com Thu Dec 17 00:16 21/554 “test”
U 2 el@tachin.com Thu Dec 17 01:08 15/474 “Test message from RoundCube”
U 3 el@tachin.com Thu Dec 17 01:15 15/474 “Test message from RoundCube”
U 4 paty@tachin.com Thu Dec 17 01:23 15/480 “Test message from RoundCube”
U 5 paty@tachin.com Thu Dec 17 01:25 21/578 “trying”
U 6 paty@tachin.com Fri Dec 18 00:55 15/480 “Test message from RoundCube”
U 7 paty@tachin.com Fri Dec 18 01:06 15/480 “Test message from RoundCube”
? q
Held 7 messages in /var/mail/el
MacMini:virtual el$
As you can see all the mail is going to /var/mail/el.
4. I am only receiving internal mail. No outside mail although port 143 is open.
5. I am not using SASL for now, so I have commented out the SASL in the main.cf
I was wondering if you can give me a few ideas as where to begin troubleshooting the problem. I have checked everything I can think of, but I am not getting anywhere. All the installations went fine. I have configured a couple of Ubuntu servers with the same stuff, so I am familiar with this stuff.
9:54 pm
@Hector, it looks like you forget to setup the directory structure correctly for some part of the installation. It could be at postfixadmin to see if that worked correctly check the database if it shows the proper directories for the user. Or it could be for courierauth.
8:53 pm
I have completely setup the round cube mail to run as localhost, but at the starting page, i dont hav any user and password to login with. Plz help me out.
9:21 pm
Brijesh, this is an older instruction which has been surpassed by a newer one. Thanks for reminding me of this page, I forgot about it. I will put a notice on it pointing to the latest one here: http://diymacserver.com/mail/snow-leopard/installing-postfixadmin/ There you should be abe to find the instructions you are looking for.
2:43 pm
I set up an RC to work at localhost with postfix, imap_L as it shown above in text. When i try to test my IMAP connection it always fails. U tried many times with different options and found that RC tries to make an SQL query into it’s database for user with id=2.
I think it’s because of $rcmail_config['auto_create_user'] logic. It set to ‘true’ but RC still tries to look for user in DB. DB is empty expect of sessions.
I am going to check PHP logic about this option now, but i really stumped already.
2:46 pm
the version of RC is 0.5.4
imap server trying to authenticate user but user occasionally disconnects.
i think RC disconnectrs from the socket because it can’t find a user in SQL DB.
maybe i’m wrong…
6:39 am
the problem was solved by hard setting a LOGIN authtype in source-code. config variable didn’t make any sense.
8:41 pm
@remort, sorry for responding too late but would you be willing to share your config of Dovecot and roundcube to see where it went wrong? It should work out of the box as described in all the documentation on this site.
Update: please mail to info @ this domain.
7:45 am
Hi, Richard. The problem was in case of installing RC + old version of courier mail (actually with imapd component). At home RC works pefectly with dovecot on my gentoo host.
The problem described in this bug ticket:
http://trac.roundcube.net/ticket/1488057#comment:6
The are two things as i have noticed: my old imapd server sends AUTH=PLAIN in CAPABILITIES string while connect. But reject this type of authentication.
But the second thing that RC does’n look in that CAP string cause when i added AUTH=LOGIN to the CAP string of imapd, RC still choose PLAIN authtype cause it’s kinda default logic in authenticate() function in RC. Something like that. So i changed this in sourcecode, because RC config-file manipulations with authtype didn’t help me to change authtype to LOGIN.
CAP string of my imapd:
CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=PLAIN IDLE XCOURIEROUTBOX=INBOX.Outbox XMAGICTRASH
i changed it to :
CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=LOGIN AUTH=PLAIN IDLE XCOURIEROUTBOX=INBOX.Outbox XMAGICTRASH
but RC still set PLAIN authtype.
Anyway problem is solved for me now.