How to use the mailparser.simpleParser function in mailparser

To help you get started, we’ve selected a few mailparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat / app / lib / server / lib / interceptDirectReplyEmails.js View on Github external
this.pop3.on('retr', Meteor.bindEnvironment((status, msgnumber, data) => {
			if (status) {
				// parse raw email data to  JSON object
				simpleParser(data, Meteor.bindEnvironment((err, mail) => {
					this.initialProcess(mail);
				}));

				this.currentMsgCount += 1;

				// delete email
				this.pop3.dele(msgnumber);
			} else {
				console.log('Cannot Retrieve Message ....');
			}
		}));
github bbyars / mountebank / src / models / smtp / smtpRequest.js View on Github external
function createFrom (request) {
    const Q = require('q'),
        deferred = Q.defer();

    const simpleParser = require('mailparser').simpleParser;
    simpleParser(request.source, (err, mail) => {
        if (err) {
            deferred.reject(err);
        }
        else {
            deferred.resolve(transform(request.session, mail));
        }
    });

    return deferred.promise;
}
github Helpmonks / haraka-plugin-mongodb / index.js View on Github external
function _mp(plugin, connection, cb) {
	simpleParser(connection.transaction.message_stream, { Iconv, 'skipImageLinks' : true }, (error, mail) => {
		if ( mail && mail.attachments ) {
			_storeAttachments(connection, plugin, mail.attachments, mail, function(error, mail_object) {
				return cb(error, mail_object);
			});
		}
		else {
			return cb(error, mail);
		}
	});
}
github sawyerh / highlight-utils / packages / kindle-email-to-json / index.js View on Github external
function toJSON(source) {
  return parseMail(source)
    .then(attachment)
    .then(convert);
}
github ReachFive / fake-smtp-server / index.js View on Github external
function parseEmail(stream) {
  return simpleParser(stream).then(email => {
    if (config.headers) {
      email.headers = formatHeaders(email.headers);
    } else {
      delete email.headers;
    }
    return email;
  });
}
github FGRibreau / smtp-to-sendgrid-gateway / utils.js View on Github external
function parse(buffer) {
  debugParser('got buffer %s', buffer);
  return simpleParser(buffer);
}
github DIYgod / RSSHub / lib / routes / mail / imap.js View on Github external
const ParserMail = async (data) => {
        const mail = await parser(Buffer.from(data, 'binary'));
        let content = mail.html || mail.textAsHtml;
        if (mail.attachments.length > 0) {
            content += `<h3>附件(${mail.attachments.length})</h3>`;
            mail.attachments.forEach((attachment) =&gt; {
                content += `<p>${attachment.filename}</p>`;
            });
        }
        return content;
    };
github sawyerh / highlight-utils / packages / highlights-email-to-json / index.js View on Github external
function toJSON(source) {
  return parseMail(source).then(convert);
}

mailparser

Parse e-mails

MIT
Latest version published 7 months ago

Package Health Score

76 / 100
Full package analysis

Similar packages