Skip to content

Commit

Permalink
fix up smtp connector and make it available by default via config
Browse files Browse the repository at this point in the history
  • Loading branch information
quartzjer committed Mar 7, 2012
1 parent d9b3edd commit 2bf667a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Common/node/lconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ exports.load = function(filepath) {
"contactsviewer:Apps/MergedContacts",
"devdocs:Apps/DevDocs",
"photosviewer:Apps/PhotosViewer",
"smtp:Connectors/SMTP",
"facebook:Connectors/Facebook",
"flickr:Connectors/Flickr",
"github:Connectors/GitHub",
Expand Down Expand Up @@ -99,6 +100,7 @@ exports.load = function(filepath) {
config.dashboard = config.dashboard || {};
config.dashboard.lockerName = config.dashboard.customLockerName || 'locker';
exports.dashboard = config.dashboard;
exports.mail = config.mail;

// load trusted public keys
var kdir = path.join(path.dirname(filepath), "keys");
Expand Down
9 changes: 8 additions & 1 deletion Connectors/SMTP/smtp.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var lfs = require('lfs');
var lutil = require('lutil');
var request = require('request');
var nodemailer = require('nodemailer');
var lcrypto = require('lcrypto');
var lcrypto;

var me;
var auth=false;
Expand Down Expand Up @@ -94,6 +94,9 @@ stdin.on('data', function (chunk) {
processInfo = JSON.parse(chunk);
locker.initClient(processInfo);
process.chdir(processInfo.workingDirectory);
var lconfig = require('lconfig');
lconfig.load('../../Config/config.json');
lcrypto = require('lcrypto');
me = lfs.loadMeData();
lcrypto.loadKeys(function(){
try {
Expand All @@ -105,6 +108,10 @@ stdin.on('data', function (chunk) {
}
}catch(e){
};
if(lconfig.mail && lconfig.mail.hasOwnProperty('host'))
{
nodemailer.SMTP = auth = lconfig.mail;
}
app.listen(processInfo.port,function() {
var returnedInfo = {};
console.log(JSON.stringify(returnedInfo));
Expand Down

0 comments on commit 2bf667a

Please sign in to comment.