1
2
I have a bunch of directories of eml files that I want upload to gmail using IMAP. I've used IMAPSync in the past to sync two IMAP accounts but these messages are just sitting on a file system as eml files they are not in an existing IMAP account where I can sync them. The eml files are all named via message ID. I want to maintain all the message properties and message attachments so that when they are in gmail I can search them and view them as complete messages. The file structure is as such.
2015mailarchives
├── 010115.xyz.archive
│ ├── account.manager
│ │ └── in
│ │ ├── 65199001.eml
│ │ ├── 65754836.eml
│ │ ├── 65860605.eml
│ │ ├── 65867970.eml
│ │ ├── 65990249.eml
│ │ ├── 65998348.eml
│ │ ├── 66004688.eml
│ │ ├── 66022610.eml
│ │ ├── 66107473.eml
│ │ ├── 66254739.eml
│ │ ├── 66293987.eml
│ │ ├── 66304813.eml
│ │ └── 66317500.eml
│ ├── adam.beck
│ │ ├── in
│ │ │ ├── 64633604.msg.eml
│ │ │ ├── 64634191.msg.eml
│ │ │ ├── 64635386.msg.eml
│ │ │ ├── 64635388.msg.eml
I don't really have to maintain the file structure. All I am trying to accomplish is to create a backup of the messages that can be searched quickly on gmail.
Any ideas on how to accomplish such a task? The files are on a headless linux box so I was hoping for something in bash, perl, python, etc.
1Are those regular plain-text .eml's or MS Outlook binary .eml's? – user1686 – 2016-10-28T16:54:11.000
Plain text. I can read them in vi. – mpmackenna – 2016-10-28T17:49:43.473