Jump to content
Pete

ProcessEmailToPage

Recommended Posts

Adrian/Pete, I am having a problem with this module on a newly fresh install of 3.0.17.

The module installs alright

post-756-0-70536500-1463528235_thumb.png

However, whenever you click the settings button, this is what I get:

post-756-0-87640100-1463528249_thumb.png

Any help you can provide is greatly appreciated.  It works on other installs (even ones that have upgraded to 3.x).  I have been meaning to spend some additional time troubleshooting this issue but just haven't had the free time.  

  • Like 1

Share this post


Link to post
Share on other sites

@Charles - i have it running on that same version with no errors;

what version of PHP are you running with that?

  • Like 1

Share this post


Link to post
Share on other sites

PHP 7 at this time.  I will downgrade it to 5.6 and see what happens.

  • Like 1

Share this post


Link to post
Share on other sites

Update: Taking it down to 5.6.19 did the trick.  It's working fine now.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks Charles,

Please try the latest version. I don't have currently have a PHP 7 setup to test so there might be additional errors, but that one should be fixed.

  • Like 1

Share this post


Link to post
Share on other sites

Went back to PHP 7.0.6 and did the  upgrade to the newest ProcessEmailToPage version.  I sent you a PM with the results.

  • Like 1

Share this post


Link to post
Share on other sites

Error seems to have resolved with new cron.

Thanks will try with "/dev/null 2>&1" if it repeats.

  • Like 1

Share this post


Link to post
Share on other sites

Went back to PHP 7.0.6 and did the  upgrade to the newest ProcessEmailToPage version.  I sent you a PM with the results.

Thanks for all the testing!

Just to let everyone else know - Charles has tested the latest version (just committed) and it is working properly with PHP 7.

Error seems to have resolved with new cron.

Thanks will try with "/dev/null 2>&1" if it repeats.

Glad you sorted out the cron issues!

  • Like 1

Share this post


Link to post
Share on other sites

I went from PHP 5.5.9 to 7.07 (on PW 3.0.22, Process Email to Page 1.1.9) and got a cron issue right away (before it was working perfectly).

This was the error message:

Error: Exception: There was an error connecting to the server. A secure connection was requested, but was not available. Try a non-secure connection instead. (in /var/www/vhosts/aic-info.de/httpdocs/pw/site/modules/ProcessEmailToPage/flourishlib/fMailbox.php line 969)

#0 /var/www/vhosts/aic-info.de/httpdocs/pw/site/modules/ProcessEmailToPage/flourishlib/fMailbox.php(1199): fMailbox->connect()
#1 /var/www/vhosts/aic-info.de/httpdocs/pw/site/modules/ProcessEmailToPage/ProcessEmailToPage.module(439): fMailbox->listMessages()
#2 /var/www/vhosts/aic-info.de/httpdocs/pw/wire/core/WireHooks.php(619): ProcessEmailToPage->importFromEmail(Object(ProcessWire\HookEvent))
#3 /var/www/vhosts/aic-info.de/httpdocs/pw/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array)
#4 /var/www/vhosts/aic-info.de/httpdocs/pw/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array)
#5 [internal function]: ProcessWire\ProcessPageView->

------------------------------------------------------------------------------------------------------------------

Adding the "/dev/null 2>&1"  to the unique URL did not reproduce the error message, but it did also not fetch the mail from the mail box. As switching back to PHP5.5.9 cures it there seem to be glitches when using PHP 7.x

Share this post


Link to post
Share on other sites

I will attempt to verify, however I am still at PW 3.0.20 (with an Automatic Page Name Format/PageTable issue reported in Github #1878)

  • Like 1

Share this post


Link to post
Share on other sites

Follow-up

I tested with PW 3.0.20 and PHP 5.6.19.  Then I then upgraded the PHP to 7.0.6.  With both PHP versions everything worked as normal.

I setup a new cron job and that is working without any problems.

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for testing @cstevensjr 

@Werner Pilnei - are you running the site as https? Can you try having the cron call the standard http version of the url instead?

  • Like 1

Share this post


Link to post
Share on other sites

@adrian Yes, the site is on https. Calling the standard url does not help - as the site rewrites it to https and I can't figure out how to reset it to not rewrite it ???.

As I have no need to go to PHP 7.x - it works with https and 5.5.9 perfectly - I can live with the status quo. Thanks for looking into that issue.

Share this post


Link to post
Share on other sites

Maybe this issue should be brought up the Flourish guys since that is where the error message is coming from. Perhaps the first thing to try is to replace the files in the flourishlib subfolder of this module with the latest versions from: https://github.com/flourishlib/flourish-classes

Even though there haven't been many changes in a while, this module is still using an outdated version of fMailbox.php

Would you mind replacing all these and seeing if it helps?

Share this post


Link to post
Share on other sites

Unfortunately  it didn't help, Adrian.

Looking at the Flourish web page I got the impression that this is a 'dead' project - the jungest blog entry is from 2012, also the forum has latest activities from 2013. That PHP 7 might have issues with these classes is probably not too strange. The fMailbox.php also indicates an age of 4 years.

Share this post


Link to post
Share on other sites

Yeah, it looks like this module really needs to move away from using Flourish. Anyone out there experienced with any good alternatives for reading emails?

Share this post


Link to post
Share on other sites

Just happened across this while randomly perusing (since I love the work Jason and Pete did with this). I have an updated version of the fMailbox.php class in my github account that may solve some of these issues.

Technically speaking, the "problem" is that newer versions of PHP are much more secure, and so when connecting to mail servers it's *actually* checking validity of certificates and credentials and what-not. The quickest way to get things working is to fall back on how PHP used to work -- no security checks. My fMailbox.php version does that. It's not the best solution, but determining exactly how to get fMailbox to properly work with all variations of servers, certificates, credentials and what-not was just not working out too well for me. In terms of a good PHP mailbox checking library, I've found that Flourish seems to have one of the best even if it is primarily a dead project.

https://github.com/BrendonKoz/flourish-classes/blob/master/fMailbox.php

There have been various GitHub users that have all forked the Flourish library and provided pull requests. I've seen some and added the few fixes that (1)I hadn't already added, or that (2)didn't conflict. That said, there have been others that have been much more active in maintaining their fork than I have.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your post @BrendonKoz - I have never actually used this module, despite contributing a fair bit of code to it, so I haven't really been pushed into finding a solution. I'd love to hear from @Werner Pilnei whether he has success with your version of fMailbox.php - if it solves his problems then it sounds like it might be the best solution for now.

Thanks again!

  • Like 1

Share this post


Link to post
Share on other sites

I haven't used it either but have thought about contributing to this particular module (since I've done work with fMailbox.php). As long as I've followed ProcessWire I still have yet to have a production website developed with it under my belt...but that will "soon" change. At that point I'll be better able to contribute.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, BrendonKoz said:

Just happened across this while randomly perusing (since I love the work Jason and Pete did with this). I have an updated version of the fMailbox.php class in my github account that may solve some of these issues.

Technically speaking, the "problem" is that newer versions of PHP are much more secure, and so when connecting to mail servers it's *actually* checking validity of certificates and credentials and what-not. The quickest way to get things working is to fall back on how PHP used to work -- no security checks. My fMailbox.php version does that. It's not the best solution, but determining exactly how to get fMailbox to properly work with all variations of servers, certificates, credentials and what-not was just not working out too well for me. In terms of a good PHP mailbox checking library, I've found that Flourish seems to have one of the best even if it is primarily a dead project.

I use this module on a daily basis and have no problem with it working on PHP 7.   The fact that newer versions of PHP are "more secure", to me is not a "problem" but a commendable thing.

Maybe I'm missing something, but the fact that this module is working on PHP 7.x with the changes made back in June (when I reported a problem), leads me to think that if there is any problem, it would be in the setup of the cronjob that the user @Werner Pelnei was using.  I originally had problems with the cronjob, but was able to to get it to work with PHP 7.x

/usr/bin/curl -s "https://www.mywebsite.com/?hash=aaaa----secret-hash----aaaa" >  /dev/null

This statement was what finally worked.

I just hope that the module works and doesn't circumvent needed security parameters introduced in newer PHP versions.  I don't want to have to stop relying on the functionality that this module gives me.  As I stated earlier, it works (without any needed new changes to the flourish library in the module) with PHP 7.x

Edited by cstevensjr
added additional detail
  • Like 2

Share this post


Link to post
Share on other sites

@adrian I am sorry but I am no longer using the module - my customer didn't want to use the functionality and so I removed it.

Thank you guys for your efforts in helping me out.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, Werner Pilnei said:

@adrian I am sorry but I am no longer using the module - my customer didn't want to use the functionality and so I removed it.

Thank you guys for your efforts in helping me out.

Thanks for getting back to me. 

@BrendonKoz - I think if everything is working fine for @cstevensjr as it is, then maybe we should just leave until there are issues for others - unless you feel strongly that the change should be made - in which case maybe you could elaborate so that @cstevensjr agrees that the change needs to be made. I'll leave this up to you guys to figure out if that's ok :)

Share this post


Link to post
Share on other sites

No, I actually side with @cstevensjr in not wanting to remove the added security. I do have some additional fixes that have nothing to do with the security certificate issues though, so at some point I'll probably offer those fixes as a patch to the plugin without introducing the reduced security. They primarily have to deal with fixing the way various mail clients and how they handle (or don't correctly handle) attachments and/or inline images.

  • Like 2

Share this post


Link to post
Share on other sites

I was getting the same error as Werner Pilnei but I am using PHP 5.6.19 so can't be a PHP 7 thing. 

 

It says that it can't make a secure connection but I have Force Secure off (on POP3) in the settings so couldn't understand why it was trying a secure connection?

I added 

echo("this-secure - ".$this->secure);

just before the fsockopen command in line 963 and it came back as FALSE so that is working but when I added 

echo("this-secure".$this->secure ? 'tls://' . $this->host : $this->host);

it came back with 

tls://mail.caltd.ie

That's not right I thought and changed the line (963)

		$this->connection = fsockopen(
			$this->secure ? 'tls://' . $this->host : $this->host,

with the plain

		$this->connection = fsockopen(
			$this->host,

And it worked.

Why this Ternary Operators doesn't work here ???

But this works:

		$this->connection = fsockopen(
			$this->secure === TRUE ? 'tls://' . $this->host : $this->host,

and keeps the functionality of the Secure / not Secure.

Hope this helps.

Robert

Share this post


Link to post
Share on other sites

Hi @RDC - thanks for the update. I just took a look at the Flourish lib's github page and it looks like there is now a PHP 7 branch so maybe there is life in the project. I know you aren't using PHP 7, but I would still be curious if this new version works for you. You can grab the required flourish files here: https://github.com/flourishlib/flourish-classes/tree/php7-compat-plus-misc-fixes

Please let me know how that goes.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      TrelloWire
      This is a module that allows you to automatically create Trello cards for ProcessWire pages and update them when the pages are updated. This allows you to setup connected workflows. Card properties and change handling behaviour can be customized through the extensive module configuration. Every action the module performs is hookable, so you can modify when and how cards are created as much as you need to. The module also contains an API-component that makes it easy to make requests to the Trello API and build your own connected ProcessWire-Trello workflows.
      Features
      All the things the module can do for you without any custom code: Create a new card on Trello whenever a page is added or published (you can select applicable templates). Configure the target board, target list, name and description for new cards. Add default labels and checklists to the card. Update the card whenever the page is updated (optional). When the status of the card changes (published / unpublished, hidden / unhidden, trashed / restored or deleted), move the card to a different list or archive or delete it (configurable). You can extend this through hooks in many ways: Modifiy when and how cards are created. Modify the card properties (Target board & list, title, description, et c.) before they are sent to Trello. Create your own workflows by utilizing an API helper class with many convenient utility methods to access the Trello API directly. Feedback & Future Plans
      Let me know what you think! In particular:
      If you find any bugs report them here or on Github, I'll try to fix them. This module was born out of a use-case for a client project where we manage new form submissions through Trello. I'm not sure how many use-cases there are for this module. If you do use it, tell me about it! The Trello API is pretty extensive, I'll try to add some more helper methods to the TrelloWireApi class (let me know if you need anything in particular). I'll think about how the module can support different workflows that include Twig – talk to me if you have a use-case! Next steps could be a dashboard to manage pages that are connected to a Trello card, or a new section in the settings tab to manage the Trello connection. But it depends on whether there is any interest in this 🙂 Links
      Repository on Github Complete module documentation (getting started, configuration & API documentation) [Module directory pending approval] Module configuration

    • By MoritzLost
      Process Cache Control
      This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Plans for improvements
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots


    • By Macrura
      PrevNextTabs Module
      Github: https://github.com/outflux3/PrevNextTabs
      Processwire helper modules for adding page navigation within the editor.
      Overview
      This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)
      Usage
      This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.
      Warnings
      If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.
      For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.
      http://modules.processwire.com/modules/prev-next-tabs/
    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
×
×
  • Create New...