oneuptime/Haraka/plugins/email_parser.js
Simon Larsen e9c94876c0
refactor: Update import statement for jest in setupTest.js
This commit updates the import statement for jest in the setupTest.js file. The previous import statement used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 14:06:41 +01:00

30 lines
943 B
JavaScript

// const MailParser = require('mailparser').MailParser;
// exports.hook_data_post = function (next, connection) {
// // Get the email data
// var email_data = connection.transaction.data_lines.join('\n');
// // Parse the email data
// var mailparser = new MailParser();
// mailparser.on('end', function(mail_object){
// // Log the email data
// connection.loginfo('Subject: ' + mail_object.subject);
// connection.loginfo('From: ' + JSON.stringify(mail_object.from));
// connection.loginfo('To: ' + JSON.stringify(mail_object.to));
// connection.loginfo('Text: ' + mail_object.text);
// connection.loginfo('HTML: ' + mail_object.html);
// });
// mailparser.write(email_data);
// mailparser.end();
// next();
// };
exports.hook_rcpt = function (next, connection, params) {
const rcpt = params[0];
this.loginfo("Got recipient: " + rcpt);
next();
};