partial-emlx-converter
Version:
Convert .emlx and .partial.emlx files created by Apple’s Mail.app to .eml
44 lines (43 loc) • 1.82 kB
TypeScript
/// <reference types="node" />
import * as plist from 'plist';
import { Transform, TransformCallback, Writable } from 'stream';
export declare function processEmlxs(inputDir: string, outputDir: string, ignoreErrors?: boolean, skipDeleted?: boolean): Promise<void>;
export declare function imapImport(inputDir: string, options: {
port: number;
ignoreErrors?: boolean;
skipDeleted?: boolean;
tls: 'yes' | 'no';
host: string;
user: string;
pass: string;
mailbox: string;
}): Promise<void>;
/**
* Process a single .emlx or .partial.emlx file.
*
* @param emlxFile Path to the file.
* @param resultStream The stream to which to write the result.
* @param ignoreErrors `true` to suppress throwing errors
* (e.g. when attachment is missing). In this case, the
* result array will contain a list of errors.
* @returns List of error messages (when `ignoreErrors` was enabled)
*/
export declare function processEmlx(emlxFile: string, resultStream: Writable, ignoreErrors?: boolean, skipDeleted?: boolean): Promise<{
messages: string[];
flags: EmlxFlags[];
plData: plist.PlistObject;
}>;
export declare const EmlxFlagNames: readonly ["read", "deleted", "answered", "encrypted", "flagged", "recent", "draft", "initial", "forwarded", "redirected", "signed", "junk", "notJunk"];
export declare type EmlxFlags = typeof EmlxFlagNames[number];
export declare class SkipEmlxTransform extends Transform {
private bytesToRead;
private bytesRead;
private skipDeleted;
private plistChunks;
readonly flags: EmlxFlags[];
plData: plist.PlistObject;
constructor(skipDeleted?: boolean);
_transform(chunk: Buffer, _encoding: string, callback: TransformCallback): void;
_flush(callback: TransformCallback): void;
}
export declare function processCli(): void;