Re: Help with retrieving messages from GMail account in Mail.app
Re: Help with retrieving messages from GMail account in Mail.app
- Subject: Re: Help with retrieving messages from GMail account in Mail.app
- From: John Kane <email@hidden>
- Date: Sun, 03 Jul 2011 16:23:31 -0600
The original use case was to find email messages that I have not already indexed. I have since moved on to using offlineimap to retrieve the email (going to have a local copy either way, either in Mail.app or via offlineimap), and then processing the mail directories in perl.
On Sun, Jul 3, 2011 at 3:37 PM, Joel Esler
<email@hidden> wrote:
You keep saying you are "looping through email" to find "what"?
On Jul 3, 2011, at 1:07 AM, John Kane wrote:
Possibilities; I was planning on looking at all of the data and figure out how I can eliminate the messages that I have already seen.
But, this is not a good fit for Mail.app, me thinks.
I have offlineimap configured and it is pulling my [Gmail]/All Mail folder now. It stores the messages in the very standard maildir format. I can easily process that format and "remember" which messages have been processed, in a number of different ways.
So, I think I am going to abandon this thread. It started out in a "rather naive" manner on my part, investigating AS for Mail.app to duplicate what I was doing manually. That was probably the wrong approach. The only reason GMail is even connected to my Mail.app is so that I can process this. fetchmail or offlineimap is probably a much better tool for this since I never read the GMail account in Mail.app
Thanks all for the patience. I did pick up a couple of pointers that will work on mailboxes that are a bit smaller than several hundred thousand messages (and growing).
On Sat, Jul 2, 2011 at 10:54 PM, Matthew Smith
<email@hidden> wrote:
There's a major problem in your logic there. Each time you will be processing through all messages in [Gmail]/All Mail. If on one run you are looping through x messages the next time you will be looping through x messages you don't want to do anything to and then y messages you do want to do something to. The time after that you will be looping through x + y messages you won't be doing anything to and z messages you do want to do something to, and so on. Your script is going to take longer and longer each time it runs if you could get it to work.
Could you not just loop through messages in the inbox and move them to a folder instead of copying them? Of perhaps forward them to a non-gmail account and process/delete them from there.
Matthew Smith
On 03/07/2011, at 14:40 , John Kane wrote:
> Sorry, I am not intentionally being obtuse; let me attempt to state the use case again:
>
> * Start the script
> * Read a file, say lastRan, looking for the last time the script ran, and set that as lastRunDateAndTime
> * Loop through all messages in [Gmail]/All Mail folder
> * If the message has a sent date greater than or equal to lastRunDateAndTime, copy the message into a specified destination folder
> * After all messages in [Gmail]/All Mail folder have been processed, write the current Date and Time Stamp into the file lastRan
> * Terminate the script
>
> I have other stuff that will process the destination folder later, that part works like a champ
>
> Mail.app might not be the correct solution for this, I am currently re-investigating fetchmail and something newer (to me) offlineimap; The latter shows some promise; I can probably do all of this from the UNIX realm
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden