Setting up Email

This guide deals with configuring email for a domain on a Symbiosis server, namely setting up mailboxes to receive email. Symbiosis makes this easy, by allowing you to create new mailboxes, or email accounts, simply by creating a few files and directories.

Things you’ll need

Before starting this section: Connect to your server over SFTP using FileZilla (see Connecting to your Server Using FTP)

We’ll be using the my-brilliant-site.com domain for demonstration purposes, but you should substitute your own domain. We’ll also be demonstrating the creation of a new email account for the user ‘bob‘, which will correspond to the email address bob@my-brilliant-site.com. You should change the name ‘bob‘ to the username you desire.

Creating a new mailbox

It has been assumed that the first few steps in the website setup guide have been followed, i.e. that a directory has been created under /srv/ for the domain my-brilliant-site.com.

  1. Start FileZilla and connect to your machine.
  2. Then right-click on the /srv/my-brilliant-site.com/ directory and select ‘Create directory‘ from the menu. Set the new directory name to be mailboxes and click the ‘OK‘ button.
  3. Repeat the process to create a directory inside mailboxes with the same name as the mailbox you want to create eg. /srv/my-brilliant-site.com/mailboxes/bob will create a mailbox for bob@my-brilliant-site.com.

Important: Please note that mailbox usernames must be lower-case!

  • Use a text editor such as Notepad to create a file password on your desktop machine which contains a secure password.
  • Under Windows a .txt extension will be added to the filename which is not wanted. So before you upload the file use FileZilla to rename it from password.txt to password. That is done by clicking with the right mouse button on the file in the lower right hand pane, and selecting Rename from the menu that appears.
  • To upload, right-click on the filename and select ‘Upload’ from the menu, making sure that the directory /srv/my-brilliant-site.com/mailboxes/bob/ is shown in the ‘Remote site:‘ text area.

That is all that is needed to set up a new mailbox. To test we can immediately use the webmail application, SquirrelMail, supplied with Symbiosis. For more information see the section Testing a new mailbox, via webmail below.

Forwarding Email

To forward emails for a specific mailbox, create a file named /srv/my-brilliant-site.com/mailboxes/bob/forward (replacing the domain name and mailbox name as required). This file should contain the email address you want to forward to eg. dave@example.com. To specify multiple email addresses, please separate each one with a comma eg. dave@example.com, jane@example.com, joan@example.com

To forward all emails for a domain, create the file /srv/my-brilliant-site.com/config/default_forward (replacing the domain name as required). This file should contain the forward address (or addresses), as above.

For more information, please refer to this reference section.

Filtering Email

Users can configure their own server-side filtering rules using the ManageSieve protocol. This is a standard protocol which can be used to create Sieve scripts which are used to filter email into folders on behalf of the user.

Sieve is a powerful language that can be used to achieve

  • mail deliveries into specific folders,
  • vacation messages,
  • flagging or highlighting mail.

ManageSieve clients are available for several mail clients, the most common of which is Mozilla Thunderbird via its Sieve add-on.

Roundcube, which is available in Symbiosis, also includes a web-based Sieve editor

Scanning email to prevent spam and viruses

Symbiosis comes with in-built virus and spam detection, however it is not enabled by default. There are two principal aspects to this, namely

  • The use of SpamAssassin to scan each email to determine if a message is unwanted.
  • The use of ClamAV to detect viruses in emails.

Each of these is configured separately, on a per-domain basis, giving choice as to which preventative measures are applied to your email.

Using SpamAssassin to detect and reject or tag spam

Email can be rejected or tagged, based on its spam score determined by SpamAssassin. This is not enabled by default, but can be enabled in much the same way as the blacklists above.

The default action is to reject, i.e., bounce, email that is determined by SpamAssassin to be spam. This can be changed to accept all email, but tag it with a header field to allow users to filter it themselves.

Once scanned, a message will have three extra headers added, for example for an innocent message might have a score of 1.2. In which case it has the following headers added.

X-Spam-Score: 1.2 X-Spam-Bar: + X-Spam-Status: innocent

A more guilty message might have a score of 4.2, but note that this message is still deemed “innocent”, since it scored less than 5, which is the default threshold at which SpamAssassin deems messages to be spam.

If a message scores more than 5, and the domain has “tag” in its config/antispam, then the X-Spam-Status header will be set to spam.

To enable spam scanning:

  1. Connect to your machine using FileZilla.
  2. On the remote directory tree, navigate to /srv/my-brilliant-site.com/config/
  3. On your local machine create a file called antispam. If you want to reject email, i.e. bounce email, that is classified as spam, this file should be empty. If you’d rather accept all email, but tag it as spam, this file should contain the word tag.
  4. Having created the file, right click on it and select upload to transfer it to the remote system. Make sure that the remote file has the correct name, i.e. no extra .txt extension.

Note: If “tagging” is configured, emails tagged as Spam are now automatically delivered to the Spam folder.

Using ClamAV to detect and reject, or tag, emails with viruses

ClamAV is activated in a similar way to SpamAssassin. It can also be set to tag or reject. Again, a header is added to message that has been scanned. In this case the header that is added is X-Anti-Virus. This is set to clean if no viruses were detected, otherwise infected, but only if configured to tag.

To enable virus scanning:

  1. Connect to your machine using FileZilla
  2. On the remote directory tree, navigate to /srv/my-brilliant-site.com/config/
  3. On your local machine create a file called antivirus. If you want to reject email, i.e. bounce email that has viruses in, this file should be empty. If you’d rather accept all email, but tag it to show that it has a virus in, this file should contain the word tag.
  4. Having created the file, right click on it and select upload to transfer it to the remote system. Make sure that the remote file has the correct name, i.e., no extra .txt extension.

Please note: ClamAV can consume a lot of memory, so we would advise against running it on servers with less than 2GiB of RAM. It can also generate large log files, taking up significant disk space. These issues affect all Symbiosis users, but those running Symbiosis Wheezy in particular. Please refer to this forum post for more information.

Testing a new mailbox, via webmail

Although most users will prefer to receive and write their emails using a dedicated client such as ThunderBird or Microsoft Outlook, the Symbiosis system includes a mail client you can access with nothing more than a web-browser. This section briefly documents using the SquirrelMail webmail system.

To log in to webmail, start your browser and head to http://my-brilliant-site.com/webmail.

Enter your email address in the Name field, and your password in the Password field.

Click the Login button and, assuming the Name and Password fields were correct, you will be presented with your Inbox where you can read and send email.

Find out more

Please see our DNS reference for further information on configuring SPF, DKIM, and DMARC for email deliverability.

Updated on February 19, 2019

Was this article helpful?

Related Articles

Have you tried Kubernetes?
Kubernetes (K8s) is helping enterprises to ship faster & scale their business. Sounds good? Let us build a K8s solution for your needs.
Register your interest