Mailhandler Module

Well, I’m just about done with this. And it was a bit of a chore. But it does work, well at that. Here are some of the point to consider

  • Have a mailbox that is accessible over the proper TCP port. when I tested secure IMAP earlier, it didn’t work because I am sure that my provider’s firewall is blocking 995. Other than that the POP3, IMAP4 stuff is pretty straightforward
  • Make sure that the email address that is sending the email to the POP3/IMAP4 account is registered to one of your user accounts. That is what the “from” authentication is all about. It has to see that the from field is known so it can be seen as an Authenticated User.**
  • Make sure that the “authenticated user” role is permitted to create content for the content type that the feed importer is attached to in the Drupal Permissions part of the user accounts
  • Make sure that the Feeds Importer that you setup is like this next bullet
  • Basic settings

    • Attached to: Static Text – this is the content type that I created for email import. you can and should create your own.
    • Periodic import: as often as possiblethis way it will pull new email from the POP/IMAP account whenever you run cron manually for testing. when you have it right, send a test email to the account, run cron and the new content will be visible when you click Content
    • Import on submission

    Fetcher

    Mailhandler fetcher

    Connects to an IMAP/POP mailbox. – these are all that you need for the Fetcher

    Parser

    Mailhandler IMAP stream parser

    Parses an IMAP stream. – these are all that you need for the Parser

    Processor

    Node processor

    Create and update nodes.

    Mapping for Node processor – this is what I have for Processor, Settings and Mapping. I believe that the Mapping is the important part and i have it below. the real key for me was the Subject source being matched to the Title target. That way the content has the subject listed in a logical place when you see the node in Content.

    Define which elements of a single item of a feed (= Sources) map to which content pieces in Drupal (= Targets). Make sure that at least one definition has a Unique target. A unique target means that a value for a target can only occur once. E. g. only one item with the URL http://example.com/content/1 can exist.

    SOURCE TARGET TARGET CONFIGURATION

    Message ID

    GUID
    Used as unique.
     Remove

    Subject

    Title
    Not used as unique.
     Remove

    Date (date)

    Published date
     Remove

    Body (HTML)

    Body
     Remove
     this makes sense once you work your way through it and see the logic. It is built this way because this way will provide you with the most flexibility later on if you want to get really complicated. It isn’t the easiest thing in Drupal, but it is far from the hardest.

** Since I am receiving email from an outside party from a mailing list, I created a dummy account with that email address.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: