# The webmail module

This is a small manual that should help you using the Webmail-Module. It is shown as the first email in the webmail module after setup, and can be found as a PDF file in `modules/webmail/docu/` as well. Written by Thomas Bley.

The webmail module gives you access to your email. It can handle multiple accounts (both POP3 and IMAP), fully supports MIME, virus scanning and multiple folders. You can send messages to other moregroupware users directly (internal), can set up shared mail folders and more. Using the adress data from the contacts module you can send messages to your clients, friends, etc. Since version 0.68 you can access your imap account directly (without downloading all messages). You can even manage all your imap folders (including create, delete and rename functions)

## The mail list

The maillist shows a list of all emails in the current folder. Opening the webmail-module the maillist shows your inbox.

### The mail list

Important messages are flagged red, unread messages bold.

The top line contains the username and the name of the folder on the left, the number of messages in the list plus the total number of messages are shown on the right. The middle is filled by the search form and "next", "previous"-links for navigating to the next or previous page of mails.

The search function tries to find the entered term in the columns subject, from and to. Select "local folders" to search for the entered term in all local folders, choose "public folders" to search in all public folders or "this folder" in order to search only in the current folder. To get a regular view of all emails in a folder, click "Cancel". (Note: the search function is not available for imap-only access)

The message that is currently displayed is marked by a lightgreen background-color:

Clicking on the subject or the sender displays a message. Clicking on the background selects a message. When selecting this is indicated by a different background color:

### Symbols for emails

  A normal email

  An email with one or more attachments

  You've replied to this email

  You've forwarded this email

  This mail has an attachment and you've replied and forwarded it

### Other symbols

  Click on this to mark an email as read / unread

  Flags an email as important / unimportant

  Only available for drafts: edit an email

## The toolbar

Functions of the symbols at the top of the screen:

### The submenu bar

### Functions in detail

  Compose an email (see Compose an email)

  Print the mail that is currently displayed in the preview pane

  Delete all mails that are marked in the maillist (how to mark, see Maillist). Mails are first moved to the trash, deleting them in the trash removes them from the system

  Reply to the mail shown in the preview pane (The text of the mail gets included to the new mail, not the attachments)

  Reply to all persons (Cc,To) to the mail shown in the preview pane (The text of the mail gets included to the new mail, not the attachments)

  Perform an (inline) forward of the mail (The text of the mail is attached to the new mail, not the attached files)

  Completely forward the mail (The whole mail [inclusing all attachments !] is included as one attachment to the new mail)

  Receive new messages (This requires an account to be set up, see Email Accounts)

  Open the tab for settings (see General Settings)

  Open the tab for account settings (see Email Accounts)

### View customization

  Minimize the sidebar. When clicking again the sidebar gets maximized.

  Hide the tree. When clicking twice the tree is visible again.

  When working with a smaller screen-resolution it may be helpful to hide the top navigation bar. Click again to display the top navigation bar and navigate to other modules.

## The sidebar

### Sidebar symbols

  Compose a new message

  See what's in your Inbox (All messages that are downloaded from a POP3/IMAP server are stored here.)

  Manage your Local Folders

  Drafts (Messages being saved for modifying/sending them later)

  Sent (All messages sent by you)

  Trash (Deleted messages, deleting messages inside the trash removes them completely)

  Public Folders (every user of moregroupware can access these folders)

## The tree

### The intial tree view

When viewing the tree for the first time it looks like this. All folders are listed hierarchical in the tree. All special folders have special icons. The folder that is currently shown in the maillist is marked with a blue background. At the end of the title the total number of mails (in this folder) is presented in brackets, e.g. "(1)"

### Unread mails in the tree view

When the folder contains unread mails then the total number of unread mails is shown before the number of read mails, e.g. (4 / 50) means 4 unread mails

### Folder actions in the tree view

To open a folder in the maillist view simply click on its title. To open the function-menu click on a folder's icon.

The function menu gives you the following possibilities:

`Open` opens the folder in the maillist view.

`Add to sidebar` shows the folder in the sidebar. ("Favorites")

`Remove from sidebar` removes the folders from the sidebar.

`Cut / Copy / Paste` (not yet implemented)

`Delete` moves the folder and all its subfolders to the trash. If the folder is already in the trash it is deleted from the tree.

### Mail actions in the tree view

`Copy / Move mails:` To copy / move mails go to the source folder, e.g. "Inbox". Mark the mails you'd like to copy / move in the maillist (Note: this function is not available in imap-only mode)

Click on the icon of the target folder and click "Copy mails" for copying or "Move mails" for moving the mails to the target folder.

`Rename a folder:` Click on icon of the folder you'd like to rename. Click "Rename" and a small box opens below containing the old name. Type in the new name and click "OK".

`Create a new folder:` Click on an icon of a folder (e.g. "Inbox"). Next click on "New Folder". A small box opens below. Type in the name of the new folder and click "OK". (e.g. a new subfolder of "Inbox" is created.)

`Properties:` Shows information about the folder and its subfolders.

`Empty (public) trash:` This option is only available for your local and public trash. It deletes all folders and emails inside the (public) trash with no option to recover the deleted items.

`Open:` Opens the whole tree.

`Close:` Closes the whole tree.

`Reload:` Reload refreshes the tree (important for imap-only mode).

## Compose an email

Composing an email requires an account to be set up. (see Email accounts )

### Search for users and contacts

To search for a special user you can type in the firstname, lastname or username.

To search for a contact you can type in firstname, lastname or email-address. You can even search for groups or companies.

To copy an item of the search-box into the to-field click on "<<" (same with cc-, bcc-field)

### Sending a message internally

To send an email to a user simply type in the username in the to-field (or cc- / bcc-field)

To send an email to a group (defined in the group-manager) simply add a "@" to the beginning of a group name. (e.g. @default)

To send an email to more than one recipient, seperate each one with a komma.

To send a copy or a blind copy click on "more" and fill in the fields "cc" and "bcc".

### Attachments

To add a file to the mail click on "Attachments".

In the next page click on "Browse ...", select a file, click on "Add to List".

To attach a file bigger than 2 MB, you need to increase "upload_max_filesize" in your php.ini, default is "2M". Btw. "file_uploads" must be set on "on" in your php.ini

To store a mail for sending it later, click on "Save as Draft" instead of "Send E-mail".

To compose big mails it may be neccessary to increase "memory_limit" in your php.ini (default is "8M")

### Add Signature

If you want your signature to be added to the end of the email, enable this oprion.

### Return receipt

When return receipt is enabled the recipient gets asked to send you a notification when he reads the mail.

It depends on the user and on his' email program if he sends you this notification.

### Send as draft

The email will not be sent to the recipient(s). Instead it is placed in the "drafts"-folder for later usage.

### Search for

If you want to search for a word in a dictionary like Thesaurus or perform a web search in google, type in a word and click "Ok".

## Folders

The "Folders" and "Public Folders" are used to get a small overview of all local or public folders. In later versions you used this to create / rename / delete folders. These functions have been moved to the tree. (see Tree)

### Select a folder

To open the folder in the maillist-view, click the underlined folder title.

### Public Folders

Public folders are the same as normal folders, except they are accessable (and writeable) by every user.

Deleting emails / folders inside the public folders moves them to the public trash.

A public folder is automatically created for every user. (public folders/$username)

## General settings

You reach "General Settings" by clicking on Settings in the webmail-module, then click on "General Settings"

Sort E-mails by:

  Control how emails in the maillist are sorted.

  - Sorting them by the "Message-ID" lists all mails in the order they were fetched, latest first.

  - Sort by "Sender": all mails are sorted by the sender, alphabetical, beginning with 'a'

  - Sort by "Subject": (same as "Sender") alphabetical, starting with 'a'

Sort by Account ?

  Check this to sort all mails by the account from which they were fetched.

Short view in maillist for columns from/to:

  The columns "from" and "to" are listed in a short way. (e.g. long: Name <name@name.com>, short: Name)

Show the size of the mails in the maillist:

  Display the size of each mail in the maillist (if this is not checked: Then the size of the mail is displayed in the preview pane)

Number of E-mails to show per page:

  Number of mails that are shown in the maillist on one page.

Time to wait after downloading/sending messages:

  The time in seconds to wait after sending or receiving mails

Always hide sidebar:

  Automatically hides sidebar. This is useful when working with 800x600.

Minimize sidebar when viewing other websites:

  This minimizes the sidebar when klicking on links in the tree / sidebar (currently unused)

Sidebar width [pixel]:

  Controls the sidebar width. (default: 100)

Tree width [pixel]:

  mpacts the width of the tree. When using large directory structures you may need to increase this value. (default: 200)

Notify me when new mails are available:

  When new mails are available on one of the accounts, a special symbol () appears in the toolbar. Clicking on it, a list of new mails is displayed. Then you are able to delete unwished mails before downloading them.

  Notifying is only active when the webmail module is opened in the browser

Time in seconds to look for new mails:

  Defines how many seconds to wait until performing a new check.

Always compose E-mails in HTML:

  Setting this a java-applet is loaded everytime you compose a new mail. (requires Sun Java Runtime Edition)

Always add signature to new E-Mails:

  The "Add Signature" checkbox is automatically enabled when composing mails.

Signature:

  Define your signature (this is a special text you can always add at the end of your mails)

Don't fetch E-mails bigger than [size in kb]:

  Enter here the maximum size of emails to fetch. "Oversize mails" are left on the account and don't get deleted

Anti-Spam Functionality:

  In order to protect you from spam you can define some rules to detect spam. Those mails that are detected as spam are moved to the "Undesired"-folder (subfolder of trash).

  Defining rules: Every rule is written in one line.

  - If you want to block a special sender type: name@domain

  - To block a whole domain type this: %@domain

  - Some spammers are using many different subdomains, to block all mails from "domain", "www.domain", "dns.domain", etc. use: %domain

Always recache E-mails (slower):

  Parsing emails can take a long time (especially for html-newsletters with many attached inline images). To parse big mails it may be neccessary to increase "memory_limit" in your php.ini (default is 8M = 8 MByte).

  Therefore all emails are cached. In the first step of the caching-process all attachments are extracted from the mail and stored at cache/attachments (for normal attachments) or at cache/img (for images).

  In the second step the rest of the mail is filtered by some criteria (see next two options for this) and stored at cache/readmessage.

Display emoticons as graphics:

  Displays emoticons as graphics in the preview pane. (e.g. :), :-), :-(, :(, ;-), :-P, :-D, :-[, :-\\ )

Enable inline display of attachments such as images, text files, etc.:

  Using this option some attachments are displayed directly in the mail. This happens to images and text-files.

  All known file-types are listed in `/webmail2/inc/mime_types.php`, all unknown file-types are treated as prossible viruses and a warning message is displayed when downloading)

Show the Structure of an E-Mail:

  Display the structure of a mail in the preview pane.

## Admin settings

You reach Admin settings by clicking on "General settings (Admin only)" in the webmail-module, then click on "General Settings"

Don't allow users to create new accounts:

  Use this option to prevent users from creating their own accounts.

Disable public folders:

  Enabling this option makes users unable to use public folders. (This option may be needed for service providers that don't want every client to share emails)

Secure HTML E-mails:

  Filters all emails with inline html-content. Most viruses contain javascript-code or redirect using iframes, etc. That's why some tags are simply filtered with this option:

  - All <script>*</script>, <applet>*</applet>, <object>*</object>

  - also <iframe>*</iframe>, <frame>, <frameset>*</frameset>

  - and <base> and <link>

  If you are programming viruses and want to test them, please unset this option or use M$ Outlook (Express).

Don't download external images:

  When viewing html-mails (e.g. newsletters) external images are not downloaded. Most companies use these images to implement a disposition notification for their spam mails.

Enable Downloading a mail as .eml file:

  This enables th ecomplete download of an email as .eml-file in the preview pane. (by clicking on structure inside the preview pane)

Disabled file extensions:

  Most viruses are sent via email including infected attachments. To block attachments you don't need, you can define its extensions. e.g. to block all .exe and .vbs-files type: .exe, .vbs

  Be aware the whole email is still fetched from your mail-server to the mgw-server, the unwanted attachments are only blocked for downloading to your computer.

Scan all ciritical attachments for viruses:

  Perform a scan for viruses of all critical attachments before downloading them. (Those attachments that are critical or not are listed in `modules/webmail2/inc/mime_types.php`)

System-path of your virus scanner:

  When scanning attachments for viruses you need to define the location of your virus-scanner. (e.g. `/usr/local/f-prot/f-prot` for Windows & F-Prot or `c:/scan/scan.exe` for McAfee-Commandline-Scanner for Windows)

Virus Scanner:

  Defines the type of your virus-scanner.

  - Supported Virus-Scanners are: F-Prot for Linux (executable: f-prot)

  - F-Prot for Windows (executable: fpcmd.exe)

  - McAfee for Linux (executable: uvscan)

  - McAfee for Windows (executable: scan.exe)

  - Kaspersky AV Linux (executable: kavscanner)

## Email accounts

### Display a list of all accounts

Inside the webmail-module, click on Settings, then click on "Accounts".

To edit an account click on "edit" (if there is no edit- or delete-link contact your sysadmin)

For deleting an account, click on "delete".

If you want to verify your smtp-settings click on "Test SMTP".

### Create a new account

Inside the webmail-module, click on Settings, then click on "New Account"

New account (imap-only)

  Create a new account for fetching emails from imap or pop3 to the database.

New account (fetch from imap or pop3)

  Create a new account for imap-only access. Emails are downloaded by demand. The imap-folders can be found in the tree (a new node with the account name is shown).

Activate Account

  Activate this option to fetch mails from this account

Account Name

  Enter the name of the account, should be unique.

Fetch all E-mails to folder

  Select the folder where new E-mails are placed after downloading. (default: Inbox)

Place a copy of each E-mail in

  Use this option to place a copy in a special folder, normally public folder (the mail is only stored once on hard-disk)

Mailserver Type

  Use POP3 for fetching mails from a POP3 server or IMAP for fetching from an IMAP inbox

POP3/IMAP Host

  Specify the hostname or IP address of the server to fetch mails from

Username

  When fetching mails authenticate with this username

Password

  When fetching mails authenticate with this password

Leave messages on server

  Activate this to leave all messages on the mail server instead of deleteing them (recommended for IMAP)

From Name

  This name appears when sending mails e.g. name for "name" <email@gmx.de>

Reply-to Address

  This address appears when sending mails e.g. email@gmx.de for "name" <email@gmx.de>

Use mail-function

  PHP offers a mail() function that calls sendmail (Linux) or SMTP (Windows) as configured in php.ini

SMTP Host

  Instead of using the mail() function you can specify a SMTP-hostname for sending mails

POP before SMTP

  Some SMTP servers require a successful POP3 authentication before sending mails

SMTP needs authentication

  Instead of authenticating via POP-before-SMTP you can use an extra username and password

Username

  Specify a username for SMTP authentication

Password

  Specify a password for SMTP authentication

Authenticate with POP3-username + Password

  Instead of using an extra username/password for SMTP authentication you can use the username/password for POP3/IMAP-authentication

#### Additional options for user "admin"

As "admin" you can create accounts for other users and allow / disallow them to edit these accounts. To create a new account for another user simply choose the username above "account name". To restrict editing uncheck "User can edit this account".

When creating users as "admin":

- using $username gets automatically replaced with mgw-username.

- using $email is replaced with mgw-email

- using $fullusername is replaced with "Firstname Lastname"

For changing moregroupware username, email and fullusername take a look at the admin-module (esp. user-manager)

## Backup Webmail (for Admins only)

### Backup your database

When you only want to backup the webmail-module these tables are important. How to backup? Using a shell command: `mysqldump -c -r <backup_filename.sql> -h <hostname> -u <username> -p%lt;password> <database> <table_name>`

- mgw_webmail_accounts - contains every user's account settings

- mgw_webmail_links - contains all external links (not used at the moment)

- mgw_webmail_mailboxes - contains all folders

- mgw_webmail_messages - contains all emails (only the headers)

- mgw_webmail_sidebar - contains the favorites (folders in sidebar/favorites)

Also important: (not webmail-module directly but neccessary for it):

- mgw_users - contains all users, usernames, userids

- mgw_groups, mgw_groups_members - contains all users, usernames, userids

- mgw_contacts, mgw_companies, mgw_contacts_groups - contains contacts (persons, companies)

### Backup you hard-disk

When you only want to backup the webmail-module these folders + subfolders are important:

- /mgw/modules/webmail2/store - contains all emails (full mails stored as .eml)

- /mgw/modules/webmail2/cache - not neccessary (should only exist)

- /mgw/modules/webmail2/home - not used at the moment