Skip to content

Mail Import Plugin for Zen Photo

I created the zpImpMail plugin to allow for easy import of photos/videos to Zen Photo via email attachments.  Installation is simple, just extract the plugin files to the user plugin directory located at $ZENROOT/plugins, then activate the plugin in the usual manner.  Once activated, the plugin is configured under the ‘Options’ => ‘Plugin’ tab.

The plugin is compatible with Zen Photo version 1.2.9 and the recently released version 1.3.

Configuration Options:

  • Album – Sets the target album for import
  • Mail Host
  • Mail User
  • Mail Password
  • Mail Parser – Determines which mail parser will be used for extracting attachments from email messages
  • Require valid sender – When checked, will check the sender address against the list of admin user email addresses
  • Debug – When checked, will output debug info to the standard Zen Photo debug log

Usage:

There are three ways to use this plugin to retrieve attachments from email.

1.  Use the ‘Import from Email’ button in the utilities section of the overview tab

2.  Navigate to:

http://yoursite.com/zendir/plugins/zpimpmail/import_email_wrapper.php

3.  Execute the above url via cron with something like the following:

curl -s http://yoursite.com/zendir/plugins/zpimpmail/import_email_wrapper.php > /dev/null 2>&1

When using method 3, it may be helpful to turn debugging on in order to verify that email is being read.

Download:

**Updated for compatibility with Zen Photo version 1.3

Get it here:  zpImpMail v. 1.0.1

{ 8 } Comments

  1. PhilY | June 3, 2010 at 11:06 | Permalink

    Hello, I’m trying to use your plugin but I can’t activate it and so I can’t configure or use it.

    I’ve put it in the ‘plugins’ folder so I have ‘ZP-CORE>plugins>zimpmail’ folder within which I have ‘zpimpmail.php’ file and ‘zpimpmail’ folder.

    But, nothing new appears in the back-end ‘plugin’ tab (activation) or back-end ‘option>plugin’ tab (configuration).

    I’m using Zenphoto 1.2.9 [5088].

    Thanks for your help.
    Phil

  2. Kevin | June 7, 2010 at 15:29 | Permalink

    Version 1.2.9 uses a different plugin structure than what you have described. As of 1.2.7 there are two different plugin directories, one for the zenphoto included ones and another for 3rd party plugins. The zenphoto plugins go in ZP-CORE -> zp-extensions and the 3rd party plugins go in [ZP-ROOT] -> plugins.

    Here is a link to the relevant section of the docs on the ZenPhoto site:

    http://www.zenphoto.org/2009/11/adding-third-party-features-to-zenphoto/

    Give this config a try and you should be able to activate the plugin.

  3. rob | June 11, 2010 at 05:10 | Permalink

    Thanks, this plugin is perfect! Worked great once I realized I needed the pecl extension installed. I have a cron job checking email once an hour and it makes it easy for friends and family to send me images for the site.

  4. PhilY | June 14, 2010 at 21:28 | Permalink

    Thanks Kevin for answering.
    Indeed, I’m mixed my words writing my comment.
    My ‘plugins’ directory is in the [ZP-ROOT] folder as it should and not in the [ZP-CORE] so it respects plugin structure for 3rd party.
    So I have: [ZP-ROOT]>plugins>zpimpmail>(zpimpmail.php file & zpimpmail folder)
    Rob is talking about ‘pecl’ extension but I can’t find it in the Zenphoto extensions repository.
    Should I install it?

  5. Kevin | June 16, 2010 at 08:23 | Permalink

    Ok, just to clarify, if you are using version 1.01 and issue ‘find plugins |grep zpimpmail’ from ZP-ROOT you should get:

    plugins/zpimpmail
    plugins/zpimpmail/images
    plugins/zpimpmail/images/mail.png
    plugins/zpimpmail/import_email_wrapper.php
    plugins/zpimpmail/import_email.php
    plugins/zpimpmail/utilities
    plugins/zpimpmail/utilities/zpimpmail_util.php
    plugins/zpimpmail/README.txt
    plugins/zpimpmail/mail_parsers
    plugins/zpimpmail/mail_parsers/builtin
    plugins/zpimpmail/mail_parsers/builtin/zpimpmail-parser.php
    plugins/zpimpmail/mail_parsers/php-mime-mail-parser
    plugins/zpimpmail/mail_parsers/php-mime-mail-parser/zpimpmail-parser.php
    plugins/zpimpmail/mail_parsers/php-mime-mail-parser/attachment.class.php
    plugins/zpimpmail/mail_parsers/php-mime-mail-parser/MimeMailParser.class.php
    plugins/zpimpmail/mail_parsers/php-mime-mail-parser.php
    plugins/zpimpmail/mail_parsers/builtin.php
    plugins/zpimpmail/functions-zpimpmail.php
    plugins/zpimpmail.php

    If everything is in the correct place you should be able to activate the plugin so if you do not have that option I’m not sure what else could be going on. If you are able to activate the plugin, then there are two ways to configure it, one using the PECL extension Mailparse and the other using PHP”s built in mail parsing functionality. Regardless of whether you have the PECL extension installed the plugin should be able to be activated.

  6. Jaanus | June 18, 2010 at 23:47 | Permalink

    Fatal error: Call to undefined function imap_open() in /home/…../plugins/zpimpmail/import_email.php on line 20

    This error message appeared after I pointed to this plugins/zpimpmail/import_email_wrapper.php

  7. Kevin | June 19, 2010 at 08:16 | Permalink

    It looks like you don’t have the php imap functions installed or enabled. Check your php.ini to see if there is a commented out line for the imap library. If so, just enable it and you should be good to go. Otherwise you will need to install php5-imap in order to get it to work.

  8. PhilY | July 17, 2010 at 14:23 | Permalink

    THANKS A LOT Kevin,
    I had an extra ‘zpimpmail’ subfolder within the ‘plugins’ folder’.
    You reply #5 helped me clarify as you suspected and it worked.

{ 2 } Trackbacks

  1. [...] made this plugin to allow import of images or videos to Zenphoto from e-mail attachments. More info about it here. No [...]

  2. Zenphoto » zpImpMail | April 23, 2010 at 13:39 | Permalink

    [...] More info and download [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *