Webmail and Virtualmin

This legacy document is here only to insure incoming links continue to work. You likely want to start with the new documentation index or search for what you want to know about. This document is unmaintained!

Webmail and Virtualmin

Introduction

A standard install of Virtualmin sets up the Dovecot server, which allows users to access their email via IMAP or POP3 from desktop clients like Outlook or Thunderbird, or mobile devices like the iPhone or Treo. However, many users prefer to access their email via a browser-based user interface, which can be used from any desktop without the need to install software.

For this reason, Virtualmin comes with the Usermin webmail interface, pre-configured to allow domain owners and mailbox users access to their email. It can also configure mail filtering, change passwords and manage folders. Alternately, you can use one of the popular PHP webmail applications like Squirrelmail or Roundcube, both of which are installable by Virtualmin.

Using Usermin for Webmail

If Virtualmin was installed using the Pro or GPL install.sh script, Usermin can be accessed via the URL https://www.example.com:20000/ , where example.com is a virtual server hosted on your system. Mail users can login with either their email address (like joe@example.com), short names (like just joe), or full usernames (like joe.example).

After logging in, users should see a list of folders on the left menu, and the contents of their inbox on the right. The Search box on the left performs a quick search of the currently selected folder. The links below it are for managing folders and preferences, changing your password, and setting up email forwarding (if allowed).

By default, Usermin's webmail interface connects to the IMAP server on the same system to access mailboxes, so for it to work Dovecot must be running and properly configured. If you prefer to have it access mail files directly, this can be configured in Virtualmin as follows :

  • Login to Virtualmin, and click on Webmin at the top of the left menu.
  • Open the Webmin category, click on Usermin Configuration, then on Usermin Module Configuration, and finally on Read Mail.
  • On the form that appears, change the Mail storage format for Inbox to Maildir.
  • Click Save.

Configuring forwarding is only possible if the system is setup to allow users to run their own .procmailrc files. This can be enabled as follows :

  • Login to Virtualmin, open the Email Messages category and click on Spam and Virus Scanning.
  • Change the Allow mailbox users to configure procmail? field to Yes.
  • Click Save.

Using Squirrelmail or Roundcube

Both these webmail applications are written in PHP, and thus can be installed into any virtual server on your system using Virtualmin's script installers feature. Once active, users can navigate to a URL like http://www.example.com/squirrelmail/ and login with their IMAP username and password to access folders and mail files.

To install either, the steps to follow are :

  • Login to Virtualmin, and select a domain from the left menu.
  • Click on Install Scripts, then on the Available Scripts tab.
  • Select either Squirrelmail or Roundcube from the list, then click the Show Install Options button.
  • In most cases the defaults on the next page will work fine. Click Install Now to complete the process.

Squirrelmail has been under development for much longer than Roundcube, and has an extensive set of plugins available. However, Roundcube has a nicer looking user interface and makes use of modern web features like AJAX to improve the user experience.

Installing Squirrelmail or Roundcube Globally

Instead of installing one of these webmail applications in each domain separately, you can create a virtual server like webmail.yourcompany.com and the install one of them there, ideally at the top level instead of under a sub-directory. This has the advantage of reducing the amount of disk space consumed by Squirrelmail installs, makes it easier to upgrade, and allows SSL access with a valid certificate for the domain.

To setup SSL access to webmail with a certificate that matches to domain name, you could do the following :

  • Make sure the webmail.yourcompany.com virtual server is on a private IP address. This can be done on the Edit Virtual Server page, in the Virtual interface field.
  • Enable SSL for the domain, also on the Edit Virtual Server page under Enabled features.
  • Click on Manage SSL Certificate on the left menu, and use the Signing Request page to generate a CSR for the domain.
  • Send the CSR to your certificate authority, who will send back a signed certificate.
  • Go to the New Certificate tab, paste in the Signed SSL certificate and click Install Now.

Users will now be able to access https://webmail.yourcompany.com/ with no SSL warnings, and thus better security.

Webmail Redirects

Starting from Virtualmin 3.60, all new domains created will have a webmail DNS entry which when accessed via a URL like http://webmail.example.com/ redirects the browser to Usermin on the same domain. This provides a more friendly URL to users, so that they don't have to remember something port 20000 in it.

The redirect URL can be customized to forward to either another webmail application on the same domain (like Squirrelmail), or a central domain for all users of your system. The latter option has the advantage that a valid signed SSL certificate can be used, as explained above.

To change the redirect URL, do the following :

  • Login to Virtualmin as root, open the System Settings category on the left menu and click on Server Templates.
  • Click on Default Settings, then select Apache website from the menu.
  • Change the URL for webmail redirect to whatever webmail location you prefer. If this should be based on the original domain, you can use the substitution ${DOM} in the URL.
  • Click the Save button.

Domains created from now on will use this redirection URL. To apply the setting to all existing domains, SSH into the system as root, and run the commands :

virtualmin modify-web --all-domains --no-webmail
virtualmin modify-web --all-domains --webmail