Closed (fixed)
Project:
Mailhandler
Version:
7.x-2.5
Component:
Mailhandler
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 May 2012 at 16:47 UTC
Updated:
20 Nov 2013 at 21:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rsutaria commentedI have gone through the detailed note on setting up mailflows given here:
http://drupal.org/node/1045918
I saw that it says: "Alternately, it will automatically import at your next cron run if you selected "As often as possible" in feed refresh period."
I'm just not able to get this working. I've set the Periodic import to "As often as possible" and then waited for the cron to run. I also manually ran the cron.
But the email just did not get imported and the node was not created. The only way I've got the node created via email is if I change the "Attach to content type" to "Use standalone form" and then if I manually go to http://domain/import and hit the submit button there.
I've just not been able to get the cron-based email import working. Is there something which I'm doing wrong?
Comment #2
danepowell commentedIn your original post, you seem to be asking whether you can import more often than cron, and the answer is no. Mailhandler, like pretty much every other task in Drupal, relies on cron to run automatically, so if you want to retrieve mail every five minutes then you also need to run cron every five minutes.
So, did you ever get it retrieving at least every hour? Because in your next post, you seem to imply that it's not retrieving any mail at all on cron runs. Is that right?
Judging by your first post I think you are misunderstanding the purpose of "attach to content type" - you should create a *new* content type to attach the importer to, and then create a node of that content type to link a mailbox to the importer and have it retrieve on cron. If you want to *create* articles, you should configure that in the Node Processor. You can also just enable the quick-start module, which sets this system up exactly as I described.
This should all be laid out in the INSTALL.txt... did you read that?
Comment #3
rsutaria commentedDane, Thanks so much for taking time to reply! I would also like to mention here that I'm immensely appreciating this module that you've written and it is providing some excellent functionality for a small project we are trying to build here in India.
Coming back to this issue: My original post does not give the correct picture. I do realize that the cron timing is what drives how often email gets imported via this module. The key issue, as you've asked, is that so far I've not been able to automatically fetch the mails every hour (or how-ever frequent the cron has been setup to execute). Even after the cron is run, the news emails that I've sent to that configured mailbox do not show up in the view.
I have gone through INSTALL.txt in detail. Maybe the use-case that I'm trying to implement using mailhandler is slightly different than what is available (or it's very possible that maybe I've misunderstood how the functionality works). I'll try to explain my use-case:
I've created a new content-type called "Items". There is a link on my site from where I'd like anonymous users to be able to add content (http://ihavethis.in/node/add/items). For this same content-type I also want to allow people to send their content via email. Hence, the need for mailhandler. In the Feed Importer settings if I give "Attach to content type" Items, then the feed box/settings show up in the node/add/items link. This is not what I want.
Basically, for the same content-type I'd like people to be able to add via the web or post via email. If I remove the setting in "Attach to content-type" and give "Use as standalone form" - I suspect I will not be able to automatically add content on cron runs. I've tried the "use standalone form" setting and it does import content from email but then I have to run this manually every-time?
Hence, is it possible to use mailhandler to allow content to be added both manually via web-link and automatically via an hourly cron-based email imports?
Sorry if I'm misunderstanding what has been written in INSTALL.txt. I've been closely trying to follow all that has been written in it, but maybe I'm not understanding correctly how the cron based imports are supposed to work.
Comment #4
danepowell commentedOkay, I think your use-case is definitely possible, and this just comes down to a misunderstanding of the 'attach to content type' setting. I agree that it's confusing, but unfortunately that's a component of Feeds, so I don't have any control over it :)
Take the following steps:
Now your mailbox should be checked every cron run (due to the mailhandler source that you created) and new items will be imported.
If this works, can you please suggest how the INSTALL.txt could be changed to make this more clear to new users?
Comment #5
rsutaria commentedDane, thanks indeed for these detailed steps!
I was able to make progress based on the settings that you have given above. But there still seems to be some mis-configuration or a bug, even after following all the steps. What is happening is as follows:
In the Feed importer I've set content-type as 'mailhandler source' and in the Feeds Importer Node Processor settings as 'Items'. I also created a new node of 'mailhandler source'. Now, when the cron ran, it did correctly import the email and a node was created but the node type was of 'Article'. I have not configured 'Article' content-type in any of the mailhandler related settings.
Hence, I feel there is a bug (not sure if in mailhandler or Feeds imported) due to which alphabetically the first content-type in the list of content-type seems to be getting set as the content-type to import.
To test my hypothesis, I deleted the 'Article' content-type from my setup and did another test run of importing an email to create a new node. This time the node did get created automatically, but on the /admin/content listing, the newly imported node has a blank content-type. Hence, maybe there seems to be some setting related to 'mailhandler source' content-type that seems to be linking itself to the "Article" content-type? (this might be a naive hypothesis but this is the only logic I could come up with :P)
In my logs, I saw this:
LOCATION http://ihavethis.in/content/new-setup
REFERRER http://ihavethis.in/admin/content?render=overlay
MESSAGE Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'comment_node_article_form' not found or invalid function name in drupal_retrieve_form() (line 795 of /home4/findston/public_html/ihavethis.in/includes/form.inc).
Regarding the INSTALL.txt, yes- I'll most certainly try to document lucidly my understanding how to get this auto-import functionality working. The main part which I had just not gathered from the txt file is that creating a node of type "mailhandler source" is imperative to this process. That step is a bit non-intuitive and hence does need to be highlighted. Will try to send something very soon.
Thanks, once again, for all the amazing assistance!
Comment #6
danepowell commentedHmm, that doesn't seem right re: the content type getting set incorrectly. I just tried Mailhandler 7.x-2.x and Feeds 7.x-2.0-alpha5 and was able to create Articles, Pages, etc... no problem by adjusting the setting at $base_url/admin/structure/feeds/mailhandler_nodes/settings/FeedsNodeProcessor.
Are you using Feeds 7.x-2.0-alpha5? It includes a lot of bug fixes, so an older version could be the problem. If that's not it, are you using any sort of patches or command plugins to dynamically set the content type?
Comment #7
rsutaria commentedHi Dane, I uninstalled both the existing Mailhandler and Feeds modules (from the modules screen as well as from filesystem) and reinstalled the latest versions of both (Feeds 7.x-2.0-alpha5+0-dev and Mailhandler 7.x-2.5+8-dev). I then recreated all the configurations as above.
The Node is still getting imported as an "Article" content-type for me. I checked in the logs but there was nothing out of the ordinary there.
Are there any debug messages that I can put somewhere to know why the content-type is getting set as Article instead of what I have configured in Feeds Node Processor (which is Items content-type)?
Comment #8
rsutaria commentedHi, I was finally able to resolve the issue of why my nodes were getting imported as type "Article".
I got a pointer to the solution based on this: http://drupal.org/node/1580408 (I was getting the exact same error string in my logs).
The solution I found on why my node were getting imported as "Articles" was because on the on the structure->Feeds importer page I had not clicked on "Override" for the "Mailhandler source" setting and instead I had created a new Importer with all the settings as given above. Once I clicked on 'Override' the status for 'Mailhandler nodes' changed from Default to Override and everything started working as expected.
From the INSTALL.txt, it was not quite evident to me that I need to click on 'Override' or how the "Override" functionality works or the effect that it has. I guess since its a Feeds related setting, it might not need to be covered in this modules files. But there is a chance many first time users of this module might never have used Feeds module too. Maybe having a small note or a reference to a URL in INSTALL.txt where the meaning of the three status in Feeds Imported - default, normal and override might help as the names of the settings are not completely intuitive.
I will most certainly try to send my suggestions on how to explain some of these things in INSTALL.txt and send it to you in a day or two. I just thought I'd put out the explanation here too, in case some other first-time users are facing similar problems.
Sincere thanks, for providing support and inputs regarding my queries!!
Comment #9
newmember commentedI had this exact issue or imports coming in as a type 'Article' instead of a 'Mailhandler source' and found your post from Google search.
Thanks for the tip.
I did the following:
1. 'cloned' the 'Mailhandler nodes'
2. changed the name of the importer and email settings of my new 'importer'
3. saved my new importer.
4. then I disabled the original 'Mailhandler nodes'
I wanted to make sure I was not using any config uration setting of the default 'Mailhandler source' settings.
Then my imports would import into the 'Mailhandler source' content type instead of an Article.
Not sure if its the best way to do this, but its working today.
Thanks
Comment #10
kscheirerSeems like this issue was resolved? Please reopen if that's not the case.