Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sendmail bug #871

Closed
ErisDS opened this issue Sep 23, 2013 · 1 comment
Closed

Sendmail bug #871

ErisDS opened this issue Sep 23, 2013 · 1 comment
Assignees
Labels
bug [triage] something behaving unexpectedly
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Sep 23, 2013

This one has been reported & fixed at least twice on the forum, here's one:

https://en.ghost.org/forum/using-ghost/263-bug-stray-n-character-when-auto-detecting-sendmail

@ErisDS
Copy link
Member Author

ErisDS commented Sep 26, 2013

FYI - the fix from the forum was

- resolve(stdout.toString()); 
+ resolve(stdout.toString().slice(0, -1));

Via email, someone else suggested:

diff --git a/core/server/mail.js b/core/server/mail.js
index 541e173..16c3b57 100644
--- a/core/server/mail.js
+++ b/core/server/mail.js
@@ -51,7 +51,7 @@ GhostMailer.prototype.detectSendmail = function () {
             if (err && !/bin\/sendmail/.test(stdout)) {
                 return reject();
             }
-            resolve(stdout.toString());
+            resolve(stdout.toString().replace(/(\n|\r|\r\n)$/, ''));
         });
     });
 };

Not sure whether we need one or both.

sebgie added a commit to sebgie/Ghost that referenced this issue Sep 26, 2013
closes TryGhost#871
- added solution from email
- tested on OSX
@ghost ghost assigned sebgie Sep 26, 2013
ErisDS pushed a commit that referenced this issue Sep 26, 2013
closes #871
- added solution from email
- tested on OSX
@ErisDS ErisDS closed this as completed Sep 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants