Difference between revisions of "Webmail"

From CSCWiki
Jump to navigation Jump to search
m (add to Software category)
Line 1: Line 1:
Webmail is offered at https://mail.csclub.uwaterloo.ca and hosted on [[Machine_List#caffeine|caffeine]]. It currently runs [http://roundcube.net/ RoundCube] as www-webmail (UID 301) via [[Suexec|suexec]] through mod_fcgid.
+
Webmail is offered at https://mail.csclub.uwaterloo.ca and hosted on [[Machine_List#caffeine|caffeine]]. It currently runs [http://roundcube.net/ RoundCube] as www-webmail (UID 301).
   
 
== Usage ==
 
== Usage ==
Line 27: Line 27:
 
| Makes an entry whenever a user sends a message.
 
| Makes an entry whenever a user sends a message.
 
|-
 
|-
| /var/log/apache2/csc-mail-access.log
+
| /var/log/apache2-webmail/csc-mail-access.log
 
| [[Apache]]
 
| [[Apache]]
 
| Logs requests to the mail vhost.
 
| Logs requests to the mail vhost.
 
|-
 
|-
| /var/log/apache2/csc-mail-error.log
+
| /var/log/apache2-webmail/csc-mail-error.log
 
| Apache
 
| Apache
 
| Logs errors generated by Apache for the mail vhost.
 
| Logs errors generated by Apache for the mail vhost.
|-
 
| /var/log/apache2/suexec.log
 
| [[Suexec|suexec]]
 
| Logs errors with suexec.
 
 
|}
 
|}
 
=== suexec ===
 
 
Webmail is currently run as www-webmail using [[Suexec|suexec]]. Suexec is fairly picky about permissions, so here are the permissions on the FastCGI wrapper stuff and their contents. This setup is known to work.
 
 
'''dr-xr-xr-x 2 www-webmail www-webmail 4096 2010-01-20 21:57 /var/lib/roundcube/fcgi-wrapper'''
 
 
'''-r-xr-xr-x 1 www-webmail www-webmail 95 2010-01-20 21:57 php-cgi'''
 
#!/bin/sh
 
export PHP_FCGI_CHILDREN=3
 
export PHP_FCGI_MAX_REQUESTS=4000
 
exec /usr/bin/php5-cgi
 
 
'''-rwxr-xr-x 1 root root 71 2010-01-20 21:34 php-cgi-suexec'''
 
#!/bin/sh
 
exec /usr/lib/apache2/suexec www-webmail www-webmail php-cgi
 
 
And here is the relevant line in the vhost configuration:
 
 
FCGIWrapper "/var/lib/roundcube/fcgi-wrapper/php-cgi-suexec" .php
 
   
 
== Patches ==
 
== Patches ==

Revision as of 14:44, 14 August 2011

Webmail is offered at https://mail.csclub.uwaterloo.ca and hosted on caffeine. It currently runs RoundCube as www-webmail (UID 301).

Usage

If you are unable to delete files, this is because you do not have a Trash folder. RoundCube should create this automatically, but if it fails to do so, simply create it yourself.

Configuration

The configuration is located in /etc/roundcube, and the database configuration is generated from /etc/dbconfig-common/roundcube.conf. At the moment, RoundCube stores its data (user preferences, etc.) in a MySQL database called csc-roundcube using a user of the same name. RoundCube is configured to auto-complete contacts from the CSC and UW LDAP directories for convenience.

Logging

A few different logs are involved in webmail (logrotate should take care of keeping them from expanding too much):

Path Written by Purpose
/var/log/roundcube/errors RoundCube RoundCube errors: Can mostly be ignored, but PHP errors get redirected here so it may be useful.
/var/log/roundcube/sendmail RoundCube Makes an entry whenever a user sends a message.
/var/log/apache2-webmail/csc-mail-access.log Apache Logs requests to the mail vhost.
/var/log/apache2-webmail/csc-mail-error.log Apache Logs errors generated by Apache for the mail vhost.

Patches

Since the lenny-backports version of RoundCube is 0.2 (not 0.3), plugin support does not exist in RoundCube at this time. As a result, a few pieces of extra functionality have been patched into the source. Firstly, the following is needed to generate CSC email addresses from user IDs (as we do not have any "mail" field in our directory). Add it in the _ldap2result function in /usr/share/roundcube/program/include/rcube_ldap.php, immediately before the return statement.

// if found by uid, put that in first
if (!$out['email'])
   $out['email'] = $out['name'];

// add domain if there is none
if (strpos($out['email'],"@") === FALSE)
   $out['email'] .= "@csclub.uwaterloo.ca";

Additionally, RoundCube does not automatically read user display names from LDAP, so by default emails have an outgoing display name of "j3doe" instead of "John Doe". There is a patch which remedies this. If you do need to reapply it, do so by hand as minor changes in that area of rcube_user.php may make automatic patching misbehave.