Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vboulaye/eml-reader
little tool to parse .eml files created from pst archive and convert them with meaningful names and searchable files
https://github.com/vboulaye/eml-reader
Last synced: 23 days ago
JSON representation
little tool to parse .eml files created from pst archive and convert them with meaningful names and searchable files
- Host: GitHub
- URL: https://github.com/vboulaye/eml-reader
- Owner: vboulaye
- Created: 2017-07-30T21:37:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T22:22:39.000Z (almost 2 years ago)
- Last Synced: 2024-04-18T02:05:16.782Z (7 months ago)
- Language: JavaScript
- Size: 282 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eml reader
just a little parser/cleaner of eml files to archive old mails in a simple searchable format.
starting from outlook pst archives, extract all eml files
```
for a in $(ls ../bak);do echo $a; readpst -e -b -o eb -j 10 -teaj ../bak/$a; done
```otherwise extract mails from the imap server using the imap-archiver.
the connection must be defined in th imap-secret.js file:```javascript
const Imap = require('imap');
const imap = new Imap({
user: 'email',
password: 'password',
host: 'imap.gmail.com',
port: 993,
tls: true,
tlsOptions: {
rejectUnauthorized: false,
},
});
module.exports = imap;
```
the constants at the beginning of the imap-archiver control the box to eas, the dates and the output:
```javascript
const outputDir = path.resolve('./target/mail');
// const BOX = 'INBOX';
const BOX = 'Éléments envoyés';
//const BOX = 'Calendrier';
const START_DATE = Date.parse('2015-07-01');
const END_DATE = Date.parse('2016-12-31');
```warning: for some reason calendar items cannot be exported
```
./imap-archiver.js
```then prune empty directories and duplicates
```
find . -empty -type d -delete
fdupes -r -d -N .
```
then we can run the cleaning script:warning : it can fail because of the stack size for mails with lots of recipients. the node command line parameter `--stack-size=16000` can help.
```
eml-reader
```some options at the top of the file:
const FIX_WRONG_ENCODING = true; // transform utf-16 back to utf-8 (wrong encoding declared)
const LOG = true; // console logthen we can delete everything wth the imap-deleter