5 var crypto = require('crypto');
7 module.exports = function(sequelize, DataTypes) {
9 var MailServerIn = sequelize.define('MailServerIn', {
10 description: DataTypes.STRING,
11 host: DataTypes.STRING,
13 type: DataTypes.STRING,
16 password: DataTypes.STRING,
17 port: DataTypes.INTEGER,
18 mailbox: DataTypes.STRING,
20 type: DataTypes.BOOLEAN,
24 type: DataTypes.BOOLEAN,
28 type: DataTypes.ENUM('UNSEEN'),
29 defaultValue: 'UNSEEN'
32 type: DataTypes.ENUM('IMAP', 'POP3'),
36 type: DataTypes.ENUM('CONNECTED', 'DISCONNECTED', 'ERROR', 'UNKNOWN'),
37 defaultValue: 'UNKNOWN'
40 type: DataTypes.INTEGER,
43 return this.getDataValue('connTimeout') ? this.getDataValue('connTimeout') / 1000 : null;
46 this.setDataValue('connTimeout', val * 1000);
50 type: DataTypes.INTEGER,
53 return this.getDataValue('authTimeout') ? this.getDataValue('authTimeout') / 1000 : null;
56 this.setDataValue('authTimeout', val * 1000);
60 type: DataTypes.BOOLEAN,
64 tableName: 'mail_servers_in'