The Omni Group

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
Mail to OmniFocus app stopped working Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by PBenz View Post
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.
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
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 :-)
  Reply With Quote
Quote:
Originally Posted by whpalmer4 View Post
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@").
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.
  Reply With Quote
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...
  Reply With Quote
Quote:
Originally Posted by whpalmer4 View Post
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?
No - the email from my friend, let's call him friend@email.com, 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 friend@email.com - ignoring message

The email from friend@email.com remained unread in my inbox, yet the email to OF was deleted.
  Reply With Quote
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!
  Reply With Quote
Quote:
Originally Posted by whpalmer4 View Post
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
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
  Reply With Quote
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?
  Reply With Quote
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.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Omnioutliner stopped working KimKelln OmniOutliner 3 for Mac 1 2012-07-19 09:59 AM
Clip-o-tron / mail.app mysteriously stopped working jrapp111 OmniFocus Extras 3 2010-03-08 05:16 PM
My sync stopped working Leila OmniFocus 1 for Mac 2 2010-01-18 11:49 PM
Bookmarklets stopped working - facej OmniWeb Bug Reports 0 2009-05-22 05:33 AM
Import from mail stopped working (build 95760)? thoresson OmniFocus 1 for Mac 3 2007-12-10 07:10 AM


All times are GMT -8. The time now is 07:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.