delete from QX_EMAIL_ROUTING 
go
delete from QX_FILTER_ACCOUNT
go
delete from QX_ACCOUNT
go
alter table QX_ACCOUNT drop column EMAIL_DOMAIN
go
alter table QX_ACCOUNT drop column EMAIL_ACCOUNT_NAME
go
alter table QX_ACCOUNT add LOGIN_NAME varchar(50) default ''
go
alter table QX_ACCOUNT alter column LOGIN_NAME varchar(50) not null
go

DECLARE @id int
EXEC dbo.QX_NEXT_KEY 'qx_sys_prop', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART) values (@id, 'DEFAULT_EMAIL_PROVIDER', 'IMAP', 'Account default email provider', 1)
EXEC dbo.QX_NEXT_KEY 'qx_sys_prop', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART) values (@id, 'DEFAULT_EMAIL_SERVER', 'mail.queplix.com', 'Account default email server name', 1)
EXEC dbo.QX_NEXT_KEY 'qx_sys_prop', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART) values (@id, 'DEFAULT_EMAIL_PORT', '110', 'Account default server port', 1)
EXEC dbo.QX_NEXT_KEY 'qx_sys_prop', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART) values (@id, 'DEFAULT_EMAIL_FOLDER', 'Inbox', 'Account default email folder', 1)
go

UPDATE QX_SYS_PROP SET PROP_VAL = '038' WHERE (PROP_ID = 'DB_CORE_VERSION');
go
