Skip to content

Commit

Permalink
Update system emails to come from ghost@blog.url
Browse files Browse the repository at this point in the history
Closes #2145
  • Loading branch information
John O'Nolan committed Mar 6, 2014
1 parent 75caeb9 commit 161afbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/server/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ GhostMailer.prototype.fromAddress = function () {
domain = config().url.match(new RegExp("^https?://([^/:?#]+)(?:[/:?#]|$)", "i"));
domain = domain && domain[1];

// Default to webmaster@[blog.url]
from = 'webmaster@' + domain;
// Default to ghost@[blog.url]
from = 'ghost@' + domain;
}

return from;
Expand Down
8 changes: 4 additions & 4 deletions core/test/unit/mail_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@ describe("Mail", function () {
done();
});

it('should fall back to webmaster@[blog.url] as from address', function (done) {
it('should fall back to ghost@[blog.url] as from address', function (done) {
// Standard domain
overrideConfig({url: 'http://default.com', mail:{fromaddress: null}});
mailer.fromAddress().should.equal('webmaster@default.com');
mailer.fromAddress().should.equal('ghost@default.com');

// Trailing slash
overrideConfig({url: 'http://default.com/', mail:{}});
mailer.fromAddress().should.equal('webmaster@default.com');
mailer.fromAddress().should.equal('ghost@default.com');

// Strip Port
overrideConfig({url: 'http://default.com:2368/', mail:{}});
mailer.fromAddress().should.equal('webmaster@default.com');
mailer.fromAddress().should.equal('ghost@default.com');

done();
});
Expand Down

0 comments on commit 161afbf

Please sign in to comment.