My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 3106: Error sending mail using sendmail: [Errno 32] Broken pipe
12 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Sep 2012

Sign in to add a comment
Reported by, Apr 17, 2010
I am running the GoogleAppEngineLauncher on Snow Leopard with --enable_sendmail
I try to send mail to Test <> and I get this error:
Error sending mail using sendmail: [Errno 32] Broken pipe

This is because the arguments to sendmail were not quoted and the <> are being 
considered redirections of stdin and stdout by the shell

Apr 17, 2010
Patch using single quotes to delineate the arguments to sendmail
750 bytes   View   Download
Aug 26, 2010
I am with the same problem:

INFO     2010-08-26 19:16:55,741] vou enviar email sobre pi de valor 6000
INFO     2010-08-26 19:16:55,742] MailService.Send
INFO     2010-08-26 19:16:55,742]   From:
INFO     2010-08-26 19:16:55,742]   To:
INFO     2010-08-26 19:16:55,742]   Subject: Nova P.I. no Vamo Que Vamo!
INFO     2010-08-26 19:16:55,742]   Body:
INFO     2010-08-26 19:16:55,742]     Content-type: text/plain
INFO     2010-08-26 19:16:55,742]     Data length: 48
/bin/sh: sendmail: command not found
ERROR    2010-08-26 19:16:55,758] Error sending mail using sendmail: [Errno 32] Broken pipe
Aug 31, 2010
you have to manually patch the appengine code until google decides to include my patch.  The mail_stub patch is above.
Oct 2, 2010
Thank you for the patch.  How did you know where to look to fix it? 
Oct 4, 2010
To answer my own question: the logs show what file problems originated in.

Apologies for the double post.
Dec 22, 2010
How would one go about applying the patch?
Jan 19, 2011
I've successfully applied this patch,  

(by using the patch command- patch < 
patching file
Hunk #1 succeeded at 155 (offset 4 lines).

I'm still getting the same error message. . 

/bin/sh: sendmail: command not found
ERROR    2011-01-19 18:26:45,422] Error sending mail using sendmail: [Errno 32] Broken pipe

Is anyone else seeing this problem?

Jan 19, 2011
Followup- Obviously my problem was different- the path for the sendmail binary was different. Duh. For snow leopard it seems to be in /usr/sbin. So I just created a symbolic link, problem fixed. 

ln -s /usr/sbin/sendmail /bin/sendmail 
Jan 26, 2011
(No comment was entered for this change.)
Status: Acknowledged
Labels: Component-Mail Component-SDK
Feb 13, 2011
#10 bob.ralian
Thanks very much for posting this patch. I manually made the change and it worked like a charm. I haven't tried this at all in production yet (not ready to deploy), was this just an issue in the dev environment?
Feb 16, 2011
Bob, this only affects your development workstation.
May 31, 2011
On trying: 
sudo patch <

I get returned a:
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
|---	2010-04-17 20:11:34.000000000 -0700
|+++	2010-04-17 20:02:52.000000000 -0700
File to patch: /Applications/
patching file /Applications/
Hunk #1 FAILED at 151.
1 out of 1 hunk FAILED -- saving rejects to file /Applications/

Any thoughts?
May 31, 2011
Also if I apply the patch manually (presuming I have applied it correctly) it returns: 

/bin/sh: -c: line 0: syntax error near unexpected token `newline'
/bin/sh: -c: line 0: `sendmail John Vong <>'

INFO     2011-05-31 08:35:44,299] MailService.Send
INFO     2011-05-31 08:35:44,299]   From: Admin <*****@****.com>
INFO     2011-05-31 08:35:44,299]   To: New User <***@********.com>
INFO     2011-05-31 08:35:44,299]   Subject: Your account has been created
INFO     2011-05-31 08:35:44,299]   Body:
INFO     2011-05-31 08:35:44,299]     Content-type: text/plain
INFO     2011-05-31 08:35:44,299]     Data length: 371
/bin/sh: -c: line 0: syntax error near unexpected token `newline'
/bin/sh: -c: line 0: `sendmail *** ***** <***@********.com>'  # this is the new user's name + email
Jun 7, 2011
#14 You probably applied the patch incorrectly. You should see
"sendmail 'John Vong <>'" (but really not anything at all)

The patch provided incorrectly escapes single quotes in a single quoted string (\' is not a valid escape)

The patch I have provided will allow multiple addresses *and* will quote the strings correctly (assuming you are running bash or something like it)

the patch should be applied to: google_appengine/google/appengine/api/
786 bytes   View   Download
Jul 25, 2011
Like a charm. Thank you.
Apr 17, 2012
(No comment was entered for this change.)
Status: Accepted
Labels: squash-1
May 16, 2012
Thanks all for this thread - a timesaver!   Jon's symbolic link suggestion did the trick for me (10.7.4) - no need for the patch.
Jul 25, 2012
(No comment was entered for this change.)
Labels: log-6880957
Sep 23, 2012
Project Member #19
Fixed in 1.7.2.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting