Webmail Plus Overview

Webmail Plus is an email client for Drupal. It's designed to provide email for any or all members of a Drupal site. It relies on a standard IMAP (Dovecot, Courier-IMAP) server for mail storage and localhost or SMTP (Postfix, Exim) server for mail delivery.

This example is based on Web sites using Webmail 6.x-1.4 with Drupal 6.8 and 6.9 then updated for Webmail Plus 6.x-1.7. Webmail Plus for Drupal 6 is still gaining features so please add to this documentation based on your successes.

We will refer to a domain named example.com because that is the international standard for example domains. By international agreement, example.com does not go anywhere or create network traffic.

Requirements

Server Setup

PHP 5.x

Webmail Plus requires PHP 5.x with IMAP and Mcrypt extensions.

SMTP server

You will need an SMTP server such as Postfix, Exim or Sendmail (not recommended). If have a shared web hosting account, you should already have this.

IMAP server

You will need an IMP server such as Dovecot (highly recommended), Courier IMAP (less recommended). If have a shared web hosting account, you should already have this.

Drupal

Drupal 6.x

Install Drupal then add in any extra modules that you need and you know will work reliably. I always use CAPTCHA and Image CAPTCHA to separate human user registrations from automated SPAM registrations. I also switch on Path so I can set the URL of content pages. pet_menu_default module automates the creation of both menu entries and URLs for content. Do not install experimental or beta modules because their code deficiencies may collide with the limitations of the relatively new Webmail Plus module.

AES module

AES provides cryptography API that Webmail Plus uses to store passwords which it intercepts at login. This allows sharing of Drupal passwords with email accounts. To use this feature you will need to select AES in the Authentication settings.

Bitcache module

Bitcache is required by the File Framework which is used by Webmail Plus to handle attachments.

RDF

The RDF module is another module required by File Framework. I used the 6.x-1.0-alpha5 version from 2009-Feb-02. RDF includes the RDF API module and the RDF Schema module. File requires only the RDF API module. RDF API has a lot of configuration settings and I used the default settings.

File Framework

Webmail Plus requires parts of the File Framework module. Most parts of the File Framework depend on the base File module, described as Allows uploading files as a standalone content type and provides a comprehensive file management framework. and the File module depend on Bitcache and Rdf.

The Fire Framework includes heaps of modules. You need File and Attachments. The default administration settings appear to work for both.

Mail API

Mail API provides an abstraction layer for accessing various mail servers and is required for Webmail Plus. I used 6.x-1.0. Go to Administer, Site building, Modules, and switch Mail API on.

Your mail server entries need a protocol and cannot be completed until you switch to IMAP-WU API to give you IMAP. Install IMAP-WU API, then comes back to Mail API.

If your mail server provides POP3 but not IMAP, you are stuffed until Mail API adds a native POP3 connection. PHP IMAP works with some PHP3 accounts and options but not all. Ask your ISP about using the IMAP protocol.

Optional Modules

ApacheSolr

Webmail Plus allows searching of emails using Apache Solr. Webmail Plus ships with Webmail Plus Solr Search module (located in the contrib directory). This module depends on ApacheSolr module so you need to install that as well.

Installation Instructions

Mail API

Return to Mail API to create a server entry. Your server entry needs a protocol IMAP-WU API provides IMAP.

Set Protocol to IMAPWU, currently the only choice.

Set Server Hostname to your mail host name, which might be something like mail.example.com.

Set Server Port to 143. Port 143 is for IMAP without SSL. 993 is for IMAP with SSL. When Mail API supplies POP3, you will be able to switch to port 110 for POP3 without SSL and 995 for POP3 with SSL.

Set Encryption to None at the start. Switch to SSL when everything else is working. If you only have SSL access, then set this option to SSL and make the port 993.

Set Domain to example.com or whatever you use for a domain.

Remove any default settings from Connection options.

Set Login Suffix to +example.com. Mail API will add your username to the front of this string. If your email user name is joe@example.com, put @example.com in this setting.

PHPMailer

Webmail Plus requires part of PHPMailer to compose mail. PHPMailer is included in Webmail Plus as of version 1.7. The version of PHPMailer that ships with Webmail Plus has been customized. Do not upgrade it! Should you try to replace it with you will lose Drafts functionality.

Webmail Plus

I used Webmail Plus 6.x-1.4.

Go to Administer, By module, Webmail Plus, and you will see the following headings.

  • Mail Storage
  • Mail Delivery
  • Authentication
  • Presentation
  • Address Book
  • User Settings
  • Publishing Settings
  • Debugging Settings

Mail Storage

In Mail Storage, under Mail Connection, select example.com. You can also switch on the use of cron if you already use cron for Drupal.

Mail Delivery

In Mail Delivery, set Mail Connection to SMTP and SMTP host to mail.example.net. For unencrypted SMTP, set SMTP port to 25 and Encryption to None. For encrypted SMTP, set SMTP port to 465 and Encryption to SSL.

Set Username to your email user name for testing. Currently Webmail Plus appears to allow only this one email address for sending all email. The username and password appear to ally only to reading email. Set Password to the password for your Username account.

Authentication

In Authentication, set Authentication Mechanism to User defined email password.

Presentation

Everything in Presentation can stay as the default for now.

Address Book

Address Book contains nothing until you install an address book module. Contact Manager is the module recommended by the Webmail Plus developers.

User Settings

In User Settings, change Preferred email format to Plain Text so that nobody has to put up with HTML unless they ask for it. Switch on Allow users to override the preferred email format to let individual users choose to annoy people with unwanted HTML.

Publishing Settings

Publishing Settings can stay at the default settings for now. When you have some email in the system, you might go to Allow publishing to these nodes and switch on Page to see what the option does.

Debugging Settings

In Debugging Settings, switch Enable debugging on. You might then find error messages in Administer › Reports › Recent log entries.

My account

Go to My account. The system may sleep for a while because Webmail Plus is looking for your email. You may get error messages if your Mail API server settings do not work with your mail server.

Select the Webmail Plus tab and enter your password. Look through the other Webmail Plus settings for your account.

View Email

Doh! This part is missing. Please fill it in. The code suggests you go to http://example.com/webmail_plus/. You probably need some sort of menu entries.

Optional modules

Webmail Plus has some optional modules that I have not yet tried. Please try them and add documentation.

URL Aliasing

Webmail Plus supports URL aliasing, which means you can replace http://www.example.com/webmail_plus with something like http://www.example.com/email. To do this you need to enable the core path module and run this query:

INSERT INTO url_alias(src,dst,language) VALUES('webmail_plus', 'email', 'en');
INSERT INTO url_alias(src,dst,language) VALUES('email', 'webmail_plus', 'en');

and visit http://www.example.com/admin/build/modules/list to allow the menu system to update.

Errors

When you go to My account for the first time, you might have to wait a while for the system to check mail then you might get the following errors. On my test site, the problem was caused by the settings in Mail API Connection options. I changed the default settings and the errors stopped.

The following error disappeared when I removed notls from Connection options.
* warning: imap_open() [function.imap-open]: Couldn't open stream {mail.example.com:995/notls}INBOX in /home/example/public_html/sites/add/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 66.

* warning: imap_check(): supplied argument is not a valid imap resource in /home/example/public_html/sites/all/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 172.

* warning: imap_fetch_overview(): supplied argument is not a valid imap resource in /home/example/public_html/sites/all/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 158.

Your email password is not correct

This error occurred all the time with lots of different settings and appears to be the default error message if the code cannot work out what happened. The underlying error can be as diverse as the PHP IMAP functions not installed.

Comments

espirates’s picture

Has anyone ever been able to get this to work in drupal ? It seems like most of the available webmail modules don't work. I tried this one awhile back too and it didn't work either.

yosilv’s picture

I agree - I tried it for a couple of hours to end up doing "hard erase" of the modules from my website directories.
it does not seem to work.

fuquam’s picture

. . . but no luck. I even tried getting all the necessary info from my hosting/email provider just to be safe but nothing has worked. It just can't seem to open a stream through port 143 to my mail server. I even tried using localhost since my mail server in on the web server.

philosophically’s picture

just a thought... i may be way wrong... but...

perhaps you just need to change your firewall settings and allow that port.. you can try typing 'setup' in terminal and the going to 'firewall settings' then 'customize' and there should be a text line for adding a port... at least I know that I can do that on CentOS Linux.... just a thought.

I am very excited to eventually implement this module, but have not as of yet.

jimsngc’s picture

Ok - it took some hours to figure the correct syntax to make it work with cyrus-imapd but I have access to the folders and email....
The real kicker is remembering to actually give the auth'd user permissions to use the module! Went round and around on that one for hours... So basic I kicked myself.

Great module - thanks for the effort!

Jim

Rory_Brooks’s picture

Hi,

I have also spent many hours trying to configure this, and no luck, if anyone can help will appreciate it?

Going to look at the following mods next, as an alternative...

http://drupal.org/project/cryptpw

http://drupal.org/project/mail2cms

Rory_Brooks’s picture

I dont believe that this module works!

I have spend an entire week, and countless installations, and re-installations. tried every configuration, read every bit of information, to no avail!

If anyone has a working installation, please let me know, so i can check it out for myself?

Seeing is believing....

I am going to give it one more go so long...

R

Rory_Brooks’s picture

Hi i have spent a week trying to get webmail plus to work!

Finally there is some hope!

I solved it by logging into squirrel mail and subscribing to the needed folders.

Users do not have an email address created for them upon registration, i have to

create one in cpanel,
then login to the user account, on the site
open cpanel webmail in another tab,
login with the user details,
subscribe to folders,

and that seems to fix it.

Still cant send mail though, but almost have it figured out... i hope!

Maybe

http://drupal.org/project/cpanel_ops

Might solve the email creation problem, during registration?

busy investigating now...

jwjoshuawalker’s picture

I see a lot of comments on here about getting it to work, just thought I'd throw in my experience.

When you first install this and start testing / configuring, the overwhelming amount of errors and slow-down of the site makes the situation feel pretty grim I agree, but in my case it was such a tiny thing that made it work.

The module does what it's supposed to do, the reason most of you aren't connecting is probably due to the imap_open() instructions required, or credentials of your email server. Keep in mind, this is trying to use the Drupal user name you are logged in as, to connect to your email server. It's also going to try and use the Drupal user's password unless u specify 'let users set password' in the settings page.

This means that by default, if your email addy is jeff@gmail.com, but your Drupal user name is admin, it's trying to log you in as admin on the gmail.com server. You can add the @gmail.com to the 'login suffix' which it would then be trying to log you in as admin@gmail.com on the gmail server. Of course this isn't your email address... I'm dissecting it currently to re-route the fetching of user name to actual user entered values from a settings page.

Anyway, back to getting it to work. Assuming you're lucky enough like me to have your own 'business gmail' or similar, where admin is an actual email user you can access, from that point it's probably just the 'Connection Options' setting on the Mail Servers page. If this is even slightly wrong, it's total failure. I suggest doing a Google search for "imap_open() instructions for ____ (email provider)". In my case, gmail wants "/imap/notls/ssl". Putting that in made it work perfectly.