title: In node.js why can't I get child_process.execSync to play nicely with sendmail?
body: <p>The variable "out" is defined thusly:</p>
  
  <pre><code>var out = "To: doug@my_domain.com\n";
  out += "From: no_reply@my_domain\n";
  out += "Subject: Form Submission\n\n";
  out += "Hello, world!\n";
  out += ".\n";
  </code></pre>
  
  <p>If I do this:</p>
  
  <pre><code>child_process.execSync('cat - &gt; /tmp/look', { input : out }).toString();
  </code></pre>
  
  <p>The contents of the "out" variable is written to "/tmp/look" exactly as one would expect.  However, if I do this:</p>
  
  <pre><code>child_process.execSync('sendmail -t', { input : out }).toString();
  </code></pre>
  
  <p>sendmail does NOT email the contents of the "out" variable as one would expect.  The complaint in the maillog is that there is no recipient address in the message header.  Further investigation reveals that sendmail is just not getting any part of the "out" variable.  Does anyone know why that would be?  Thanks for any help.</p>
  
  <pre><code>  ... doug
  </code></pre>
  
  <p>PS:  I think that I neglected to mention one very important fact.  This is a CGI script.  Everything works just fine when I call the script manually (i.e., "./script_name" at the command prompt).  I'm only experiencing the problem when I trigger the running of the script by submitting a form.  Here is the exact error message that I am receiving:  "May 20 01:29:15 vm0-61 postfix/sendmail[22223]: fatal: apache(48): No recipient addresses found in message header".  Thanks.  Sorry for the omission.</p>