The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus 1 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=38)
-   -   Mail to OmniFocus app stopped working (http://forums.omnigroup.com/showthread.php?t=25159)

nicbox 2012-08-09 03:02 AM

Mail to OmniFocus app stopped working
 
After upgrading to Mountain Lion, I've noticed that I can no longer send mails to my OF inbox.

My set up is OF (from App Store) running on a Mac Mini with Mail set up using a single purpose mailbox. The Mac is running as a server (headless) and is used for adding new tasks via mail, which are then managed using the ipad app.

The Mail rule is enabled and I can see mail arriving in the mailbox, but the script is not moving the message into OF.

Help appreciated!
Thanks

jbrown 2012-08-09 10:04 AM

You may want to try the troubleshooting steps here:

[url]http://www.omnigroup.com/support/omnifocus-mtn-lion[/url]

We recently submitted an update to Apple that addresses issues with the Mail Rule and Clip-O-Tron in Mountain Lion, but they need to review and approve the update before it can be made available in the Mac App Store.

Feel free to [EMAIL="omnifocus@omnigroup.com"]email us[/EMAIL] if you're still having trouble. Thanks!

nicbox 2012-08-23 02:32 AM

App upgraded
 
Now running 1.10.3 (v77.90.17), disabled the 'add mail rule' option in OF, re-enabled which then prompted me to restart mail which I did. Sent a test email, but still not adding to the OF inbox.

Anyone have any suggestions?
Many thanks
Nic

jbu 2012-08-23 09:46 AM

I have asked support about this as I have the same problem. Here is the answer:

"Unfortunately we are finding that starting in OS X Snow Leopard, the Mail rule has worked for fewer and fewer customers. It seems that in many cases Mail executes the rule but doesn't actually fire the script that adds the new inbox item to OmniFocus; you can tell if this is happening to you by observing if the message is marked as read and/or moved to the designated archive folder within Mail.

We hope to get around this growing problem by adding a feature to the Omni Sync Server which will add mails sent to a special address directly to your database on the server"

nicbox 2012-08-28 08:23 AM

Thanks for this. I guess I was one of the lucky ones using Lion, but now fall into line with the masses under Mountain Lion :-)

This is one of the features I could really do with, given that it simplifies the process of 'managing your mailbox' - just have to wait patiently :)

nick101 2012-08-29 12:29 AM

Odd - it's now working for me but I had to reinstall OF/Mac to get it back (yes, I had been using the latest version).

Full steps:
Uncheck the mail option
Reinstall OF
Check the mail option (I use the leading -- approach, if it makes a difference)
Mail restarts and all seems OK - for now

Clip-o-tron works too

granmon 2012-08-31 07:57 AM

Try this....
 
I've tried to debug the script: Send to omnifocus

The script (on my computer) stopped working in the lines:

if AllowedSender does not contain trimmedSender and AllowedSender does not contain theSender then

log "OmniFocus Mail Rule: Received message from unauthorized sender " & trimmedSender & " - ignoring message"
return

Apparently the criteria for an interruption of the script (ie. ignoring the message) are fullfilled.

I made this part of the script to a comment by writing -- in front of each line.
(or delete the lines)

Afterwards it works....

Thomas

masoric 2012-09-12 07:35 PM

Great tip granmon! This worked for me too!

whpalmer4 2012-09-12 09:27 PM

Did you check to make sure that the account the email is being sent from is in the "allowed senders" list in the OmniFocus preferences? All those lines that were removed do is spit out an error message (to help you (or the support ninjas) figure out why you aren't getting your email into OmniFocus), and then return without adding the message (so that no one can insert stuff in your database without your permission). What you've done by commenting out those lines is akin to removing the lock on your back door so you won't be inconvenienced if you forget your key :-)

PBenz 2012-09-13 05:20 AM

In my case, the script thinks that the sender of the message is not me, even though the email in Sent Items is definitely from me. You can see the log message in the Console app. It thinks the email is from somebody else:

9/13/12 8:02:46.938 AM OmniFocus[5624]: OmniFocus Mail Rule: Received message from unauthorized sender <incorrect email address here> - ignoring message

I sent another test from a different email account, and it worked. And then I sent a 3rd test from the original account, and now that worked too! Weird.

There is a clue, though: the person associated with the incorrect email address sent me an email about 20 minutes before I sent the email to OF. It was sitting in my inbox unread. I can't seem to reproduce the problem, though.

whpalmer4 2012-09-13 09:26 AM

[QUOTE=PBenz;114473]In my case, the script thinks that the sender of the message is not me, even though the email in Sent Items is definitely from me. You can see the log message in the Console app. It thinks the email is from somebody else:

9/13/12 8:02:46.938 AM OmniFocus[5624]: OmniFocus Mail Rule: Received message from unauthorized sender <incorrect email address here> - ignoring message

I sent another test from a different email account, and it worked. And then I sent a 3rd test from the original account, and now that worked too! Weird.

There is a clue, though: the person associated with the incorrect email address sent me an email about 20 minutes before I sent the email to OF. It was sitting in my inbox unread. I can't seem to reproduce the problem, though.[/QUOTE]

That means your correspondent with the incorrect email address sent you a message which got run through the rule for OmniFocus. Unless you've altered your Mail rule, that means it matched against the condition you specified (subject line starting characters or recipient containing "+omnifocus@"). That preference is just used to construct the rule in Mail.app that chooses which messages to attempt to process with the OmniFocus applescript, and you can tinker with the rule or even build your own if you want something else. I've got over a dozen such rules feeding email into OmniFocus, and the allowed senders list is rather lengthy.

If there's any doubt about which message is triggering the rule, you could extend the logging a bit, perhaps something like this:
[code]
-- Allow the user to type in the full sender address in case our trimming logic doesn't handle the address they are using.
set theSender to sender of theMessage
set theSubject to subject of theMessage
set theText to content of theMessage
if (length of theText > 80) then
set theText to text 1 through 80 of theText
end if
set trimmedSender to my trim_address(theSender)
tell application "OmniFocus"
set AllowedSender to allowed mail senders
if AllowedSender does not contain trimmedSender and AllowedSender does not contain theSender then
log "OmniFocus Mail Rule: Ignoring message from unauthorized sender " & trimmedSender & return & " Subject: " & theSubject & return & " Text: " & theText
return
end if
end tell

[/code]

I've only tested that fragment on a 10.6.8 system; your mileage may vary with Lion or Mountain Lion. Whoever put the original log message in got burned by some difference between the various cats (the result being that the script didn't compile on Snow Leopard after the change was made, and so the mail rule didn't work at all until the problem was corrected!) so I'm a bit sensitive here :-)

PBenz 2012-09-13 10:47 AM

[QUOTE=whpalmer4;114477]That means your correspondent with the incorrect email address sent you a message which got run through the rule for OmniFocus. Unless you've altered your Mail rule, that means it matched against the condition you specified (subject line starting characters or recipient containing "+omnifocus@"). [/QUOTE]

If that were true, then wouldn't the email have been deleted just like test emails to OmniFocus? Deleting the message is the first step in the rule (and I believe that's the default - I did not change the OmniFocus rule), yet the email from the incorrect corespondent remained in my inbox.

It seems that the script received false information somehow. It's like the correct email was run through the rule, but the script thought it was from somebody else. I suppose this could be a bug in Mail itself.

And to clarify, it's working just fine now after I sent a test email from a different email address to OF, verified that it worked, then sent another one from my primary email address.

Very strange indeed.

Thanks for the code, btw. I will give that a shot if it starts acting up again.

whpalmer4 2012-09-13 11:07 AM

That is indeed interesting. There doesn't appear to be any signaling of success or failure by the script back to Mail, so even if we were to propose that perhaps the script is fired off before the message is actually deleted, there's nothing to alert Mail to abort the processing of the rule and leave the message unmolested.

So is the timestamp on the log message within a few seconds of when you received the email that remained unread but seemingly triggered the error? Trying to rule out the possibility that there was another message from the same sender which triggered the rule and was deleted...

PBenz 2012-09-13 11:16 AM

[QUOTE=whpalmer4;114486]So is the timestamp on the log message within a few seconds of when you received the email that remained unread but seemingly triggered the error? [/QUOTE]
No - the email from my friend, let's call him [email]friend@email.com[/email], arrived at 11:02pm last night, and my email to OF was processed at 11:26pm. Here's the exact log message:

9/12/12 11:26:29.291 PM OmniFocus[5624]: OmniFocus Mail Rule: Received message from unauthorized sender [email]friend@email.com[/email] - ignoring message

The email from [email]friend@email.com[/email] remained unread in my inbox, yet the email to OF was deleted.

whpalmer4 2012-09-13 11:36 AM

Did you have the Mail app open at the time your friend's email hit the server? And are you positive that you only received one email from this friend? Did your email to OmniFocus make it into the database? How many of these showed up in the log?

OmniFocus calling process_message in MailAction script

Certainly possible there's some race condition or other bug in Mail that results in the wrong information being handed off now and then, but I've run many hundreds of messages through this feature without encountering it. Makes me rather curious!

PBenz 2012-09-13 12:17 PM

[QUOTE=whpalmer4;114489]Did you have the Mail app open at the time your friend's email hit the server? And are you positive that you only received one email from this friend? Did your email to OmniFocus make it into the database? How many of these showed up in the log[/QUOTE]
Yes, yes, no, and 2 - this morning I sent another test email to OF and got the same result. It was at that point that I sent a 3rd email but from a different email account. That one went through, and now the original email works as well.

Bizarre, right? I prefer to actively work on this problem by not thinking about it. lol

thebd 2012-09-17 09:08 PM

I am having the same problem. I tried Granmon's suggested edits to the script but that did not fix the problem.

OmniGroup, any idea when this will be fixed?

nunez 2012-12-13 09:01 PM

I can confirm a problem with the script, but it's slightly different symptoms. The logs confirm that the process_message is being called, but nothing is showing up in Omnifocus. It did work, once, when a message was in the inbox with the right subject line, and I right-clicked and said 'run rules', but never automatically.

Short version: mail rules are working fine, process_message broken.

Asterion 2013-09-29 10:52 AM

Has anyone managed to get this MailAction script to work? Has anyone at Omni bothered to look at this?

I use Mail Act-On to allow messages to be marked as 'Actions', various tags set (in MailTags) and then it sent to OmniFocus with a single "~A" keystroke. This USED to work, but hasn't for a while. Nothing now happens when the script is called.

Can Omni please either update the Applescript with a working version, or at the very least identify what the problem is? I realise that you're all working on OF2, but your customers are still hobbling along with an buggy / unfinished version 1. It speaks volumes about Omni that nothing every seems to be properly finished or resolved. There are always lots of promises about future features and "power", but the the day-to-day experience is one of extreme frustration that nothing ever [I]quite[/I] works or is [I]quite[/I] implemented properly.

It's always jam tomorrow, and never jam today.

gcarey3 2013-10-14 10:39 AM

1 Attachment(s)
I spent a little time looking at this today since I really wanted the email feature to work.

I found the script itself worked okay but it would process the wrong message which means generally it would fail because the sender wasn't correct. It would also create lots of stuff in OF. I am using IMAP for the mail account.

The solution for me was to delete the action to delete the email and also any action to move it to a folder. I could still mark it as read however.

I even tried to break the processing into two separate rules, one to run the script and another to move or delete the email. Wouldn't work that way either.

As soon as any rule (even a later one) touched the email to move it somewhere the script would process the wrong email.

For now I simply set up a separate email box and mark the messages read then stop processing rules. I just leave them in the Inbox (undeleted). I added additional matching criteria against the new mail account too for good measure. That seems to work okay so far. Here is my screenshot of the mail rule. I didn't have to modify the applescript (except a little for initial debugging).

My environment is OSX 10.8.5 and Mac Mail 6.6 (1510).

Hope this helps someone.


All times are GMT -8. The time now is 07:13 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.