If you use the Mailhandler module and you want different user accounts to have their own mailbox to send content to a site, you are required to configuring multiple Mailhandler mailboxes for each account as well as multiple feeds to process each mailbox. The provisioning of mailboxes on a mail server and configuration of so many Mailhandler mailboxes and the associated feeds could be automated, but it would be pretty gnarly.
The solution we came up with was to have a single mailbox on the mail server, and have a single mailhandler and single feed processor for the a site. Instead of each user getting their own inbox, we have a single inbox that collects email from any number of addresses. This can be done by either configuring the mail server to have a single ‘catch all’ address or, if available, a plus addressing scheme (think GMail).
What does this module do?
The module exposes the 'Send content by mail' permission.
The module provides a user interface to generate unique 'email addresses' for each user on the site with the 'Send content by mail' permission.
Why is that useful?
On its own, theses two features do not provide too much utility. However, in combination with Mailhandler, and Mailhandler Send to Authentication a Feed importer can be configured to retrieve messages from a single mailbox and authenticate each message against the lists of unique 'email addresses' generated by users. The emails can then be processed to create nodes on the site and have the senders be attributed as authors of the content.
Mailhandler Send To Auth
Mailhandler PHP IMAP
Besides the installation of dependencies, there are no special installation instructions for this module.
- If you do not already have an email account set up:
- Create a 'catch all' email account.
- OR Create an email account that supports 'plus' addressing (e.g. gmail)
- Configure a Mailhandler mailbox to use the account from step 1)
see: Mailhandler documentation (specifically http://drupal.org/node/207366)
- Go to admin/config/content/singlemailbox
Set the ‘default mailbox’ to the one configured in step 2)
Select the address format. The format you choose depends on the type of mailbox that was configured in step 1 and 2. Choose ‘Default addressing’ (for ‘catch all’ mailboxes). Choose Plus Addressing if you are using a mailbox that supports it.
- Configure a Feeds module 'feed' to import messages using the Mailhandler
mailbox configured in step 2)
Ensure that 'send to authentication' is the authentication method used when importing messages.
(Note that you'll need to enable feeds_ui module to add a Feeds importer.)
To configure permissions go to admin/people/permissions
You may grant the 'submit content by mail' permission to a role
You may also grant the 'configure single mailbox settings' to a role
Generating email addresses
If a user has the 'submit content by mail' permission edit the user's profile. Under the section titled: 'E-mail address to submit content.'
Click the 'generate new' link.
Extending the Module
Mailhandler Single Mailbox provides two Ctools plugins for generating email addresses by default.
If you would like to change the way email addresses are generated you can create your own plugin.
The plugin must be of type 'mailhandler_singlemailbox_address_generator'
Your class must implement the MailhandlerSinglemailboxAddressGenerator interface. In other words your class must have a 'generate' method.
You may extend the MailhandlerSinglemailboxAddressGeneratorBase abstract class or you may create a completely custom implementation.
Mail Media Module
For convenience we have provided the Mail Media Module as part of Mailhandler Sinble Mailbox Module. It is a glue/feature module that provides and example configuration for importing emails with photo or video link attachments. It does the work of creating a node type and defining a configuration for a feeds importer making use of Mailhandler. It pre-configures the a feed fetcher, parser and processor.
Use it as is, or learn from it and come up with your own configuration.