diff --git a/src/addons.js b/src/addons.js index 190851c55..62f462aad 100644 --- a/src/addons.js +++ b/src/addons.js @@ -437,7 +437,7 @@ function setupSendMail(app, options, callback) { assert.strictEqual(typeof callback, 'function'); // FIXME: to can conflict with a real user! - var from = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '-app'; + var from = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '.app'; var cmd = [ '/addons/mail/service.sh', 'add-send', from ]; @@ -458,7 +458,7 @@ function teardownSendMail(app, options, callback) { debugApp(app, 'Tearing down sendmail'); // FIXME: to can conflict with a real user! - var from = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '-app'; + var from = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '.app'; var cmd = [ '/addons/mail/service.sh', 'remove-send', from ]; @@ -479,7 +479,7 @@ function setupRecvMail(app, options, callback) { debugApp(app, 'Setting up recvmail'); // FIXME: to can conflict with a real user! - var to = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '-app'; + var to = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '.app'; var cmd = [ '/addons/mail/service.sh', 'add-recv', to ]; @@ -498,7 +498,7 @@ function teardownRecvMail(app, options, callback) { assert.strictEqual(typeof callback, 'function'); // FIXME: to can conflict with a real user! - var to = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '-app'; + var to = (app.location ? app.location : app.manifest.title.replace(/[^a-zA-Z0-9]/, '')) + '.app'; var cmd = [ '/addons/mail/service.sh', 'remove-recv', to ]; diff --git a/src/user.js b/src/user.js index a2678f556..5befef6e8 100644 --- a/src/user.js +++ b/src/user.js @@ -91,7 +91,7 @@ function validateUsername(username) { // +/- can be tricky in emails if (/[^a-zA-Z0-9.]/.test(username)) return new UserError(UserError.BAD_USERNAME, 'Username can only contain alphanumerals and dot'); - if (username.indexOf('-app') !== -1) return new UserError(UserError.BAD_USERNAME, 'Username pattern is reserved for apps'); + if (username.indexOf('.app') !== -1) return new UserError(UserError.BAD_USERNAME, 'Username pattern is reserved for apps'); return null; }