Hi thanks for your response. The problem i am facing here is , i need to 
handover my code to sysadmin who deploy them behind a firewall and load 
balancers. I think right choice for me is chmod as suggested by Harald.  It 
solves my immediate problem. And again this trick won't work on windows 
machines. I think this problem will be continued until node provides a way 
to compile user modules just like node core. 

Thank you for all of you for sharing your thoughts.

Koti

On Thursday, January 10, 2013 1:54:17 AM UTC+5:30, ashiso wrote:
>
> Hi,
>
> I'm also hosting a mail script on a shared hosting environment with shell 
> access.
> Like you, I didn't want to code email adresses and passwords into the file.
> To do that, I use prompt (https://npmjs.org/package/prompt). My code 
> looks like this:
>
> var prompt = require("prompt"),
>     nodemailer = require("nodemailer"),
>     password = "",
>     mailOptions = {
> from: "",
> to: "", 
> subject: "Email from website",
> html: "<b>html body</b>"
> };
>
> prompt.start();
>
> // get input from stdin
> prompt.get(["from", "to", "password"], function (err, result) {
>     mailOptions.from = result.from;
>     mailoptions.to = results.to;
>     password = result.password;
>     
>     // expressjs
>     app.listen(7331);
> console.log('Listening on port 7331');
> });
>
> // more code [..]
>
> sendMail();
>
> So now  when I start the process Prompt asks me for the stuff:
> $ node app.js
> prompt: from: [email protected] <javascript:>
> prompt: to: [email protected] <javascript:>
> prompt: password: thesecretpassword
>
> If you want better security, you could keep the username and password 
>> only in the memory of a long running daemon process. That way, at 
>> least someone may need to read the virual memory of that process in 
>> order to get the password, not that this is incredibly hard either.
>>
>
> Hm. Is it really so easy to get the password out of a node process which 
> is not owned by your user? I hope not! :-)
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to