You are here

INSTALL.txt in Mailhandler 7.2

Same filename and directory in other branches
  1. 6.2 INSTALL.txt
CONTENTS OF THIS FILE
---------------------

 * Requirements
 * Quick setup
 * Overview
 * Importer configuration
 * Source configuration
 * More information

REQUIREMENTS
------------

You will need to have access to a dedicated mailbox (IMAP or POP3) to receive
posts via email. You must also have the PHP IMAP library installed- see the
documentation at https://drupal.org/node/300794.

Dependencies:
- ctools
- feeds

QUICK SETUP
-----------

The goal of this tutorial is to show you how to quickly import messages from
any mailbox using cron. After you've got this working, refer to the sections
below for a deeper understanding of Mailhandler's architecture.

There are three basic items that need to get set up:
- Mailhandler Mailboxes store connection settings for an IMAP/POP3 mailbox
- Feeds Importers import messages from those mailboxes
- Feeds Source nodes link a specific importer to a specific mailbox to allow
  automatic imports on cron runs

Note that all of these components can be reused in various ways. For instance,
you could have one Importer retrieve messages from multiple Mailboxes by
creating a Source node for each Mailbox. Or, multiple Importers could run on
one mailbox (with one Importer looking for nodes and the other looking for
comment replies).

Before you get started, you'll need to have a working Drupal installation and
the required modules (dependencies) listed above. No configuration of those
modules should be necessary.

The quick-start module provides a test Mailbox and message, a default Importer,
and a Source content type. Try to import this test message now:
- Go to $base_url/admin/modules
- Enable the "Mailhandler quick-start" module.
- Go to $base_url/node/add/mailhandler-source
- Give the node a title (such as 'Test source').
- For "Feed"->"Mailbox", select the mailbox to import from.
- Save the node. You should see the message 'created 1 story node'. Congrats,
  you just imported your first node with Mailhandler 2.x!
- If you go to $base_url/admin/content/node, you should see the 'Test source'
  node and the imported test message (which should be unpublished).

Now that you've verified that the basic features are working, it's time to
customize them to suit your own needs:
- Send a test email to an IMAP or POP3 mailbox. If you are using the default
  authentication options, you must send the email from the same address
  as your Drupal user account.
- Go to $base_url/admin/structure/mailhandler/add
- Fill in the details for your IMAP/POP3 mailbox. Mailhandler will report how
  many messages are in the mailbox if it is able to connect. Click "Save".
- Follow the steps for 'Import a test message' (above) to import messages from
  the mailbox. Note that only unread messages will be imported.

Note that new emails will be imported on cron runs. If you'd prefer that new
messages NOT be imported automatically, you will need to edit the default
importer ($base_url/admin/structure/feeds/edit/mailhandler_nodes/settings) and
for 'Attach to content type' select 'Use standalone form'. Messages can then be
manually imported at $base_url/import/mailhandler_nodes.

OVERVIEW
--------

Mailhandler fetches content from IMAP or POP mailboxes, which are represented
by the mailhandler_mailbox_ui class. Feeds Importers configured to use the
Mailhandler Fetcher can use these mailboxes as Feeds Sources, in the same way
that Importers using the HTTP Fetcher would use URLs as sources.

Thus, at the bare minimum you must configure at least one mailbox and at least
one Feeds Importer, as described in the section above.

A Feeds Importer is made up of a Fetcher, Parser, and Processor. Mailhandler
provides only a Fetcher and Parser, and requires the use of an existing
processor (typically, the Node Processor or Comment Processor). Additionally,
Mailhandler defines two types of plugins that extend the Mailhandler Parser:
'authentication plugins' match the sender of the email to a Drupal user
account, while 'commmand plugins' extract various parts of a message (such as
files and IMAP headers) and allow users to 'command' attributes of created
content using key: value pairs.

You can either manually run an importer, or you can attach an importer to a
content type. Then you'll need to create a new node of the corresponding type,
choosing from the node form which mailbox to tie to that node, save the node,
and then you'll be able to import from the node view of that node, or import on
cron.

Finally, Mailhandler provides some input filters that can strip common garbage
from imported messages (such as signatures).
  
IMPORTER CONFIGURATION
----------------------
-- Fetcher --
Using the 'filter' setting, choose which types of messages to retrieve (nodes,
comments, or all). Note: if this importer fetches a type of message that the
processor (below) does not support, that message will be marked as read or
deleted! Thus, it's important to set this filter appropriately.

-- Parser --
Choose plugins to handle commands and authentication, as well as set available
commands. The commands plugins generate mapping sources that will appear in the
processor mapping form in the next step.

-- Processor --
You will most likely want to use the Node Processor or Comment Processor.

For Nodes Processor settings, choose (among other things) whether authorization
should be performed- in other words, whether the post author has permissions to
actually post content (by default Feeds doesn't check this).

For Nodes Processor mappings, you'll need to map "sources", provided by the
Mailhandler Parser and its command plugins, to node "targets". Note that if you
don't map things correctly here, certain features that you configured earlier
(such as authorization and commands processing) will not work.

To prevent re-importation of duplicate messages, you will want to map the
"Message ID" source to a field and mark it as unique. For more information, see
http://drupal.org/node/1329218

If you would like to import comments by email, you can download Mailcomment and
Feeds Comment Processor and select the Feeds Comment Processor instead.

SOURCE CONFIGURATION
--------------------
Source nodes are what link your Importer to a specific mailbox and allow
messages to be imported on cron runs. Here you can also set "default commands"
that will be applied to all messages imported by this source node.

For instance, if you set available commands (in the parser configuration) to
"status", mapped "status" to "Published status" (in the processor
configuration), and set default commands (in the source configuration) to
"status: 1", all imported posts will be published by default. Users can
override this by placing the command "status: 0" at the top an email's body.

MORE INFORMATION
----------------

More documentation is located at http://drupal.org/handbook/modules/mailhandler
which discusses topics such as how to configure mailboxes for specific email
providers.

File

INSTALL.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Requirements
  4. * Quick setup
  5. * Overview
  6. * Importer configuration
  7. * Source configuration
  8. * More information
  9. REQUIREMENTS
  10. ------------
  11. You will need to have access to a dedicated mailbox (IMAP or POP3) to receive
  12. posts via email. You must also have the PHP IMAP library installed- see the
  13. documentation at https://drupal.org/node/300794.
  14. Dependencies:
  15. - ctools
  16. - feeds
  17. QUICK SETUP
  18. -----------
  19. The goal of this tutorial is to show you how to quickly import messages from
  20. any mailbox using cron. After you've got this working, refer to the sections
  21. below for a deeper understanding of Mailhandler's architecture.
  22. There are three basic items that need to get set up:
  23. - Mailhandler Mailboxes store connection settings for an IMAP/POP3 mailbox
  24. - Feeds Importers import messages from those mailboxes
  25. - Feeds Source nodes link a specific importer to a specific mailbox to allow
  26. automatic imports on cron runs
  27. Note that all of these components can be reused in various ways. For instance,
  28. you could have one Importer retrieve messages from multiple Mailboxes by
  29. creating a Source node for each Mailbox. Or, multiple Importers could run on
  30. one mailbox (with one Importer looking for nodes and the other looking for
  31. comment replies).
  32. Before you get started, you'll need to have a working Drupal installation and
  33. the required modules (dependencies) listed above. No configuration of those
  34. modules should be necessary.
  35. The quick-start module provides a test Mailbox and message, a default Importer,
  36. and a Source content type. Try to import this test message now:
  37. - Go to $base_url/admin/modules
  38. - Enable the "Mailhandler quick-start" module.
  39. - Go to $base_url/node/add/mailhandler-source
  40. - Give the node a title (such as 'Test source').
  41. - For "Feed"->"Mailbox", select the mailbox to import from.
  42. - Save the node. You should see the message 'created 1 story node'. Congrats,
  43. you just imported your first node with Mailhandler 2.x!
  44. - If you go to $base_url/admin/content/node, you should see the 'Test source'
  45. node and the imported test message (which should be unpublished).
  46. Now that you've verified that the basic features are working, it's time to
  47. customize them to suit your own needs:
  48. - Send a test email to an IMAP or POP3 mailbox. If you are using the default
  49. authentication options, you must send the email from the same address
  50. as your Drupal user account.
  51. - Go to $base_url/admin/structure/mailhandler/add
  52. - Fill in the details for your IMAP/POP3 mailbox. Mailhandler will report how
  53. many messages are in the mailbox if it is able to connect. Click "Save".
  54. - Follow the steps for 'Import a test message' (above) to import messages from
  55. the mailbox. Note that only unread messages will be imported.
  56. Note that new emails will be imported on cron runs. If you'd prefer that new
  57. messages NOT be imported automatically, you will need to edit the default
  58. importer ($base_url/admin/structure/feeds/edit/mailhandler_nodes/settings) and
  59. for 'Attach to content type' select 'Use standalone form'. Messages can then be
  60. manually imported at $base_url/import/mailhandler_nodes.
  61. OVERVIEW
  62. --------
  63. Mailhandler fetches content from IMAP or POP mailboxes, which are represented
  64. by the mailhandler_mailbox_ui class. Feeds Importers configured to use the
  65. Mailhandler Fetcher can use these mailboxes as Feeds Sources, in the same way
  66. that Importers using the HTTP Fetcher would use URLs as sources.
  67. Thus, at the bare minimum you must configure at least one mailbox and at least
  68. one Feeds Importer, as described in the section above.
  69. A Feeds Importer is made up of a Fetcher, Parser, and Processor. Mailhandler
  70. provides only a Fetcher and Parser, and requires the use of an existing
  71. processor (typically, the Node Processor or Comment Processor). Additionally,
  72. Mailhandler defines two types of plugins that extend the Mailhandler Parser:
  73. 'authentication plugins' match the sender of the email to a Drupal user
  74. account, while 'commmand plugins' extract various parts of a message (such as
  75. files and IMAP headers) and allow users to 'command' attributes of created
  76. content using key: value pairs.
  77. You can either manually run an importer, or you can attach an importer to a
  78. content type. Then you'll need to create a new node of the corresponding type,
  79. choosing from the node form which mailbox to tie to that node, save the node,
  80. and then you'll be able to import from the node view of that node, or import on
  81. cron.
  82. Finally, Mailhandler provides some input filters that can strip common garbage
  83. from imported messages (such as signatures).
  84. IMPORTER CONFIGURATION
  85. ----------------------
  86. -- Fetcher --
  87. Using the 'filter' setting, choose which types of messages to retrieve (nodes,
  88. comments, or all). Note: if this importer fetches a type of message that the
  89. processor (below) does not support, that message will be marked as read or
  90. deleted! Thus, it's important to set this filter appropriately.
  91. -- Parser --
  92. Choose plugins to handle commands and authentication, as well as set available
  93. commands. The commands plugins generate mapping sources that will appear in the
  94. processor mapping form in the next step.
  95. -- Processor --
  96. You will most likely want to use the Node Processor or Comment Processor.
  97. For Nodes Processor settings, choose (among other things) whether authorization
  98. should be performed- in other words, whether the post author has permissions to
  99. actually post content (by default Feeds doesn't check this).
  100. For Nodes Processor mappings, you'll need to map "sources", provided by the
  101. Mailhandler Parser and its command plugins, to node "targets". Note that if you
  102. don't map things correctly here, certain features that you configured earlier
  103. (such as authorization and commands processing) will not work.
  104. To prevent re-importation of duplicate messages, you will want to map the
  105. "Message ID" source to a field and mark it as unique. For more information, see
  106. http://drupal.org/node/1329218
  107. If you would like to import comments by email, you can download Mailcomment and
  108. Feeds Comment Processor and select the Feeds Comment Processor instead.
  109. SOURCE CONFIGURATION
  110. --------------------
  111. Source nodes are what link your Importer to a specific mailbox and allow
  112. messages to be imported on cron runs. Here you can also set "default commands"
  113. that will be applied to all messages imported by this source node.
  114. For instance, if you set available commands (in the parser configuration) to
  115. "status", mapped "status" to "Published status" (in the processor
  116. configuration), and set default commands (in the source configuration) to
  117. "status: 1", all imported posts will be published by default. Users can
  118. override this by placing the command "status: 0" at the top an email's body.
  119. MORE INFORMATION
  120. ----------------
  121. More documentation is located at http://drupal.org/handbook/modules/mailhandler
  122. which discusses topics such as how to configure mailboxes for specific email
  123. providers.