Trouble debugging Mail module - my fault I'm sure.

21 views
Skip to first unread message

Eric Dykstra

unread,
May 26, 2013, 7:23:23 PM5/26/13
to sil...@googlegroups.com
Mike and everyone,

I use the Mail module on another project. It works great. Slick and simple.

However, on this new project, I can't seem to figure out why the email is not being sent. Well - the root cause anyway.

After preparing the email, the code executes the 'emailMessage.send();' method, and in the console, I see: "sh: sendmail: command not found".

Here is the test code segment:

var console = require('console');
var Mail        = require('Mail').Mail;

var emailMessage = new Mail();
            
emailMessage.setFrom('sys...@MyDomain.com');
emailMessage.setTo('m...@MyDomain.com');
emailMessage.setSubject('Subject.');
emailMessage.setText('Body.');
            
emailMessage.send();    

This is a 'cut and paste' from the working project. So, I doubt the issue is there. It has to be an environment issue.

On both projects, the silkjs executable is being run by the same user I log in as ('webdev'). When I log in as webdev, I can find sendmail from the command line with 'locate sendmail', but not with 'which sendmail'. That doesn't make sense. If it is a PATH issue, they should both fail.

Anyways, the test command "echo body | mail -vs subject m...@mydomain.com;" works on both systems.

When I installed the mail packages, it was with:

apt-get install postfix heirloom-mailx -y;

What is the next step in debugging? I have almost zero experience with the silkjs console, and I get stuck there with getting 'undefined' all the time.

Any help is appreciated.

Thanks,

Eric

Michael Schwartz

unread,
May 26, 2013, 11:17:36 PM5/26/13
to sil...@googlegroups.com
You need to have sendmail installed ;)

For ubuntu:

sudo apt-get install sendmail


--
You received this message because you are subscribed to the Google Groups "SilkJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silkjs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Schwartz

unread,
May 26, 2013, 11:19:04 PM5/26/13
to sil...@googlegroups.com
On May 26, 2013, at 4:23 PM, Eric Dykstra <virtu...@gmail.com> wrote:

Eric Dykstra

unread,
May 27, 2013, 7:16:28 AM5/27/13
to sil...@googlegroups.com
Mike,

No, sendmail is not installed. The alternative solution of postfix and heirloom-mailx is, and it works on the other server with SIlkJS Mail Module without issue.

When I log in as the same user that the silkjs process is owned by, I do NOT see sendmail in the path, as defined with the output of 'which sendmail'. But, again, that is the same on the functioning system. Further, 'locate sendmail' does find the 'simulated' sendmail that is installed with the postfix/heirloom packages.

So, since the beginning, I am pretty much convinced this is not a SilkJS issue. It is a shell environment issue. I am just stuck at how to work with SilkJS to debug this further.

Ideas?

Eric

Eric Dykstra

unread,
May 27, 2013, 12:50:02 PM5/27/13
to sil...@googlegroups.com
Everyone,

Ugh. I was taking the approach of; 'If it works in the old system, it should work in the new system.'

So, when the PATH variable was the same in each, I didn't attempt to change it.

Then I took the approach that maybe the old system had '2 wrongs make a right', so I ignored it and continued.

Sure enough - it was simply that sendmail was not in the PATH.

It still is not in the PATH of the old system, and it still works. I have no clue why - and I don't care at this point. Moving forward. :)

Sorry for what turned out to be a non-SilkJS debugging related post.

Eric


On Sunday, 26 May 2013 19:23:23 UTC-4, Eric Dykstra wrote:
Mike and everyone,

I use the Mail module on another project. It works great. Slick and simple.

However, on this new project, I can't seem to figure out why the email is not being sent. Well - the root cause anyway.

After preparing the email, the code executes the 'emailMessage.send();' method, and in the console, I see: "sh: sendmail: command not found".

Here is the test code segment:

var console = require('console');
var Mail        = require('Mail').Mail;

var emailMessage = new Mail();
            
emailMessage.setFrom('system@MyDomain.com');
emailMessage.setTo('me@MyDomain.com');
emailMessage.setSubject('Subject.');
emailMessage.setText('Body.');
            
emailMessage.send();    

Michael Schwartz

unread,
May 27, 2013, 1:31:16 PM5/27/13
to sil...@googlegroups.com
Get sendmail on the user's path and it should work.


Reply all
Reply to author
Forward
0 new messages