Search code examples
emailgmail

Gmail forwarding loop, gmail


I assure you this is a programming question: someone asked about this same problem before and was told that this is not a programming question, but that is because he did not phrase it as such. Please read my full description.

The Problem: I just graduated from college and want to transfer all my emails in my college account (henceforth "account O" for old) to a regular gmail account (henceforth N). Note that account O is powered by Gmail, and is effectively a gmail account.
Gmail has a suggested means for doing this: POP/IMAP. But, this did not work for me, and it has failed many others (see here); upon trying to sync by IMAP, my account N is bombarded with messages reading "A message in your account was listed with an invalid size. It has been left on the server."

It would seem natural to try to mass-forward all of one's emails. But google does not allow such an action. Other people say to use a filter, because filtered items can be mass-forwarded. But you can't filter by date, and there is no way to get the filter to select everything.

My workaround, and where I need more experience programmer advice: I want to run a program which signs into my account O and finds the first email I ever received. Then, I want to begin a for loop which runs through all of my emails where the body of the loop does the following: a) click the forward button b) type in my account N email address c) hit "next", so that the 2nd email I ever received shows up, and so on.
This would accomplish my task.

Unfortunately, all I have under my belt is a semester of C++, some knowledge of statistical scripting languages (ie R), and VBA. I don't know how to make code interact with the internet. Could someone tell me a language and how to do this?

Thanks, Ryan


Solution

  • While you are correct in saying that the approach you want to take to this problem makes it a programming question, Ben makes a valid point that your question probably does not confirm to site guidelines.

    To answer your problem, pretty much any language should be able to handle this, as nearly all have libraries for working with SMTP. However, this is most likely overkill and I would not suggest programming your own solution when other alternatives exist.

    If you receive that message when trying to import mail (or add an account) in gmail's web interface, you should try to import them using an actual mail client such as Thunderbird, a procedure for which is described here. If you have already tried that but still encounter errors, you can use GMail Loader to read archive emails from a variety of formats and mass forward them to a gmail address.