1 (edited by tyllee 2021-02-23 21:46:03)

Topic: Error: allowedsenders doesn't have a default. Migration

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: RHEL 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

https://forum.iredmail.org/topic17593-i … again.html

We have installed new server with RHEL 8.3. Migrated accounts from VMAIL from old debian server. And when trying to create new users from iRedAdmin Pro SQL 4.7 we get:

Error: InternalError(1364, "Field 'allowedsenders' doesn't have a default value")
After migration:
old db value:   `allowedsenders` text NOT NULL,

Before migration in new server:
New db value:   `allowedsenders` text DEFAULT NULL,

New server
RHEL 8.3: mysql  Ver 15.1 Distrib 10.3.27-MariaDB, for Linux (x86_64) using readline 5.1


Old server:
Debain 8: mysql  Ver 15.1 Distrib 10.0.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Is there any update that should be run to correct this, we have iRedMail 1.0 in old server with all sql adjustments.

When investigating databases there seams to be different default values between the servers databases. Structure looks sort of the same, importing is going fine without any warnings or errors.

We notice also that Innodb is the default method for a new system. Our old db is in myisam format.

https://mariadb.com/kb/en/converting-ta … to-innodb/


Convert into InnoDB
USE vmail;
ALTER TABLE admin ENGINE=InnoDB ;
ALTER TABLE alias ENGINE=InnoDB ;
ALTER TABLE alias_domain ENGINE=InnoDB ;
ALTER TABLE anyone_shares ENGINE=InnoDB ;
ALTER TABLE deleted_mailboxes ENGINE=InnoDB ;
ALTER TABLE domain ENGINE=InnoDB ;
ALTER TABLE domain_admins ENGINE=InnoDB ;
ALTER TABLE forwardings ENGINE=InnoDB ;
ALTER TABLE mailbox ENGINE=InnoDB ;
ALTER TABLE maillists ENGINE=InnoDB ;
ALTER TABLE moderators ENGINE=InnoDB ;
ALTER TABLE recipient_bcc_domain ENGINE=InnoDB ;
ALTER TABLE recipient_bcc_user ENGINE=InnoDB ;
ALTER TABLE sender_bcc_domain ENGINE=InnoDB ;
ALTER TABLE sender_bcc_user ENGINE=InnoDB ;
ALTER TABLE sender_relayhost ENGINE=InnoDB ;
ALTER TABLE share_folder ENGINE=InnoDB ;
ALTER TABLE used_quota ENGINE=InnoDB ;

This is just an enhancement. Default values still a problem. Find all that differ and convert them.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Error: allowedsenders doesn't have a default. Migration

Few SQL columns in "vmail.mailbox" table are deprecated and safe to drop them.

- allowedsenders
- rejectedsenders
- allowedrecipients
- rejectedrecipients

MySQL commands:

USE vmail;
ALTER TABLE mailbox DROP COLUMN `allowedsenders`;
ALTER TABLE mailbox DROP COLUMN `rejectedsenders`;
ALTER TABLE mailbox DROP COLUMN `allowedrecipients`;
ALTER TABLE mailbox DROP COLUMN `rejectedrecipients`;

3

Re: Error: allowedsenders doesn't have a default. Migration

Thank you ZhangHuangbin!
This resolved our issue;

ZhangHuangbin wrote:

Few SQL columns in "vmail.mailbox" table are deprecated and safe to drop them.

- allowedsenders
- rejectedsenders
- allowedrecipients
- rejectedrecipients

MySQL commands:

USE vmail;
ALTER TABLE mailbox DROP COLUMN `allowedsenders`;
ALTER TABLE mailbox DROP COLUMN `rejectedsenders`;
ALTER TABLE mailbox DROP COLUMN `allowedrecipients`;
ALTER TABLE mailbox DROP COLUMN `rejectedrecipients`;

4

Re: Error: allowedsenders doesn't have a default. Migration

Forgot to mention that we will officially drop them in next iRedMail release.