3 var db = require('../../mysqldb').db;
4 var logger = require('../logger')('app');
6 exports.create = function() {
16 email: 'email@xcally.com',
18 description: 'service motion account auto generated',
23 .spread(function(entity, created) {
25 logger.info('service motion account auto generated');
30 return db.MailServerOut.findOrCreate({
32 MailAccountId: account.id
40 authentication: false,
41 MailAccountId: account.id,
42 description: 'service motion smtp auto generated'
46 .spread(function(entity, created) {
48 logger.info('service motion smtp auto generated');
51 return db.MailServerIn.findOrCreate({
53 MailAccountId: account.id
60 MailAccountId: account.id,
61 description: 'service motion imap auto generated'
65 .spread(function(entity, created) {
67 logger.info('service motion imap auto generated');
70 .catch(function(err) {
71 logger.error('Can\'t create Mail Accounts');