diff --git a/Haraka/config/host_list.ini b/Haraka/config/host_list similarity index 100% rename from Haraka/config/host_list.ini rename to Haraka/config/host_list diff --git a/Haraka/init.sh b/Haraka/init.sh index 5e4a8c47b7..f539df420a 100644 --- a/Haraka/init.sh +++ b/Haraka/init.sh @@ -3,6 +3,7 @@ # Setup auth echo "domain = $DOMAIN" >> /harakaapp/config/dkim_sign.ini echo "$DOMAIN" > /harakaapp/config/host_list +echo "$INCOMING_EMAIL_DOMAIN" >> /harakaapp/config/host_list echo "$DOMAIN" > /harakaapp/config/me echo "$SMTP_EMAIL=$SMTP_PASSWORD" >> /harakaapp/config/auth_flat_file.ini @@ -23,9 +24,6 @@ echo "Type: TXT" echo "Key: $DKIM_SELECTOR._domainkey" echo "v=DKIM1;p=$(grep -v '^-' /harakaapp/config/dkim/$DOMAIN/public | tr -d '\n')" -# Add Hosts -echo $DOMAIN >> /harakaapp/config/host_list.ini -echo $INCOMING_EMAIL_DOMAIN >> /harakaapp/config/host_list.ini # Run haraka haraka -c /harakaapp \ No newline at end of file diff --git a/Haraka/plugins/email_parser.js b/Haraka/plugins/email_parser.js index 67b2a62e6d..2bea75127a 100644 --- a/Haraka/plugins/email_parser.js +++ b/Haraka/plugins/email_parser.js @@ -1,23 +1,30 @@ -const MailParser = require('mailparser').MailParser; +// 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'); +// 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(); +// // 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.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(); +// mailparser.write(email_data); +// mailparser.end(); +// next(); +// }; + + +exports.hook_rcpt = function (next, connection, params) { + var rcpt = params[0]; + this.loginfo("Got recipient: " + rcpt); next(); -}; +} \ No newline at end of file