3 module.exports = function(sequelize, DataTypes) {
5 var MailServerIn = sequelize.define('MailServerIn', {
6 description: DataTypes.STRING,
7 host: DataTypes.STRING,
9 type: DataTypes.STRING,
12 password: DataTypes.STRING,
13 port: DataTypes.INTEGER,
14 mailbox: DataTypes.STRING,
16 type: DataTypes.BOOLEAN,
20 type: DataTypes.BOOLEAN,
24 type: DataTypes.ENUM('UNSEEN'),
25 defaultValue: 'UNSEEN'
28 type: DataTypes.ENUM('IMAP', 'POP3'),
32 type: DataTypes.ENUM('CONNECTING', 'CONNECTED', 'DISCONNECTED', 'ERROR', 'UNKNOWN'),
33 defaultValue: 'UNKNOWN'
36 type: DataTypes.STRING
39 type: DataTypes.INTEGER,
42 return this.getDataValue('connTimeout') ? this.getDataValue('connTimeout') / 1000 : null;
45 this.setDataValue('connTimeout', val * 1000);
49 type: DataTypes.INTEGER,
52 return this.getDataValue('authTimeout') ? this.getDataValue('authTimeout') / 1000 : null;
55 this.setDataValue('authTimeout', val * 1000);
59 type: DataTypes.INTEGER,
62 return this.getDataValue('pollingTimeout') ? this.getDataValue('pollingTimeout') / 1000 : null;
65 this.setDataValue('pollingTimeout', val * 1000);
69 type: DataTypes.BOOLEAN,
73 type: DataTypes.BOOLEAN,
77 tableName: 'mail_servers_in'