# Webmail

URL: https://docs.vaultpanel.net/guides/dns-and-email/webmail

> Give your mailboxes webmail with Roundcube from the app installer, on a website of its own, and keep it up to date by hand or automatically.

Webmail lets people read and send mail in the browser. VaultPanel installs **Roundcube** for this through the [app installer](https://docs.vaultpanel.net/guides/websites/cms-installer), on a website of its own such as `webmail.example.com`. Mailboxes sign in with their full email address and their password. There is no separate admin account.

Installing webmail needs agent 0.45.0 or newer on the website's server, and updating it needs 0.46.0 or newer.

## How it works

- Roundcube reads mail over IMAP (port 993, TLS) and sends it over SMTP (port 587, STARTTLS) through the mail server on the website's own server. When that server has no mail server, it uses the first mail server set up in the panel.
- The newest stable Roundcube release comes from the Roundcube project's GitHub releases and is checked against its published SHA-256 before it is unpacked.
- Roundcube goes in a project folder at the top of the website (`roundcube` by default), and the website serves only that folder's `public_html/`. Roundcube's settings, logs and temporary files are never public.
- The app installer makes a database and a database user for Roundcube and writes them to `config/config.inc.php`. They count toward a hosting customer's plan like any other.
- Roundcube's web installer is removed after the install.

## Before you start

- A mail server set up on the **Email** page. See [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting).
- A PHP website for webmail, with PHP 8.1 or newer, or let the installer make a new one. Point the domain's DNS at the server.
- The `websites.manage` and `databases.manage` permissions.

## Set up webmail

### Open the Webmail card

Go to **Web > Email**. Once a mail server is set up, the page has a **Webmail** card. Click **Set up webmail**. The app installer opens with **Roundcube** chosen.

### Choose the website

Pick **An existing PHP website** or **A new website**. For a new website, enter its **Domain** (such as `webmail.example.com`), **Site name** and **PHP version**.

### Choose the project folder

Keep `roundcube` as the **Project folder**, or enter another name. The folder is made at the top of the site. A website can hold only one Drupal, Laravel or Roundcube app.

### Install

Click **Install Roundcube**. The address is shown, and the install takes a minute or two. Its row on the **Webmail** card shows **Installing**, then the address as a link.

> **Important:**
Give the website an SSL certificate, so passwords are never sent in plain text. Until it has one, the card shows **No HTTPS yet**. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates).

Roundcube is set up with the Junk folder as its spam folder, so it works with [spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering). Sessions end after 30 minutes without use.

## Updates

Roundcube security fixes come out often. Each Roundcube on the **Webmail** card shows its version and when it was last checked.

- The panel checks every Roundcube for a newer release about once a day.
- When a newer release is out, the card shows the new version as available and an **Update to** button with the version number. Click it to update now.
- **Check for updates** asks for the newest release now.
- Tick **Update automatically** to let the panel update that Roundcube by itself when its daily check finds a newer release.

An update uses Roundcube's own `bin/installto.sh`, which keeps the settings, logs and the data in its database, then updates Roundcube's tables. The release is checked against its SHA-256 like an install. An update never goes back to an older version. When an update fails, the card shows **The last update did not finish** with the error.

Updating needs the `websites.manage` permission.

## Remove webmail

Roundcube is an installed app of its website. Remove it from the website's **Apps** tab like any other app. See [App installer](https://docs.vaultpanel.net/guides/websites/cms-installer).
