mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-10 11:24:39 +03:00
parent
75caeb9341
commit
161afbf3c4
@ -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;
|
||||
|
@ -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();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user