My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  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 zectb...@gmail.com, Apr 17, 2010
I am running the GoogleAppEngineLauncher on Snow Leopard with --enable_sendmail
I try to send mail to Test <test@test.com> 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 <test@test.com> are being 
considered redirections of stdin and stdout by the shell

Apr 17, 2010
#1 zectb...@gmail.com
Patch using single quotes to delineate the arguments to sendmail
mail_stub.brokenpipe.patch.py
750 bytes   View   Download
Aug 26, 2010
#2 mvtgo...@gmail.com
I am with the same problem:

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

Apologies for the double post.
Dec 22, 2010
#6 ASMedr...@gmail.com
How would one go about applying the patch?
Jan 19, 2011
#7 jon.bow...@gmail.com
I've successfully applied this patch,  

(by using the patch command- patch < mail_stub.brokenpipe.patch.py 
patching file mail_stub.py
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 mail_stub.py:177] Error sending mail using sendmail: [Errno 32] Broken pipe

Is anyone else seeing this problem?

Jan 19, 2011
#8 jon.bow...@gmail.com
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
#9 i...@google.com
(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
#11 zectb...@gmail.com
Bob, this only affects your development workstation.
May 31, 2011
#12 kai.chan...@artfinder.com
On trying: 
sudo patch < mail_stub.brokenpipe.patch.py

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:
--------------------------
|--- GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail_stub.py	2010-04-17 20:11:34.000000000 -0700
|+++ GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail_stub.py	2010-04-17 20:02:52.000000000 -0700
--------------------------
File to patch: /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail_stub.py
patching file /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail_stub.py
Hunk #1 FAILED at 151.
1 out of 1 hunk FAILED -- saving rejects to file /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/mail_stub.py.rej


Any thoughts?
May 31, 2011
#13 kai.chan...@artfinder.com
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 <kai@artfinder.com>'

INFO     2011-05-31 08:35:44,299 mail_stub.py:95] MailService.Send
INFO     2011-05-31 08:35:44,299 mail_stub.py:96]   From: Admin <*****@****.com>
INFO     2011-05-31 08:35:44,299 mail_stub.py:100]   To: New User <***@********.com>
INFO     2011-05-31 08:35:44,299 mail_stub.py:110]   Subject: Your account has been created
INFO     2011-05-31 08:35:44,299 mail_stub.py:114]   Body:
INFO     2011-05-31 08:35:44,299 mail_stub.py:115]     Content-type: text/plain
INFO     2011-05-31 08:35:44,299 mail_stub.py:116]     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 Terence....@gmail.com
kai.chan.vong@artfinder.com You probably applied the patch incorrectly. You should see
"sendmail 'John Vong <kai@artfinder.com>'" (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/mail_stub.py
mail_stub.py.patch
786 bytes   View   Download
Jul 25, 2011
#15 whitnel...@gmail.com
Like a charm. Thank you.
Apr 17, 2012
#16 nickjohn...@google.com
(No comment was entered for this change.)
Status: Accepted
Labels: squash-1
May 16, 2012
#17 alister....@gmail.com
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
#18 dhermes@google.com
(No comment was entered for this change.)
Labels: log-6880957
Sep 23, 2012
Project Member #19 tmat...@google.com
Fixed in 1.7.2.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting