Setting wont be saved.

Issue #54 closed
Chris created an issue

Hi! i installed your plugin, i see the config-options in the Identities Section but the Information wont be saved.
Always get back to this state.

any ideas?

Comments (19)

  1. Chris reporter

    imported the mysql initial file…but error comes up

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'label
    varchar(32),
    flags
    int
    NOT NULL
    DEFAULT 0,
    smtp_host
    varcha' at line 1

  2. Chris reporter

    soooo i get the import to work.

    SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
    SET AUTOCOMMIT = 0;
    START TRANSACTION;

    CREATE TABLE ident_switch (
    id int(10) UNSIGNED NOT NULL,
    user_id int(10) UNSIGNED NOT NULL,
    iid int(10) UNSIGNED NOT NULL,
    username varchar(64) DEFAULT NULL,
    password varchar(64) DEFAULT NULL,
    imap_host varchar(64) DEFAULT NULL,
    imap_port int(11) DEFAULT NULL,
    imap_delimiter char(1) NOT NULL,
    label varchar(32) DEFAULT NULL,
    flags int(11) NOT NULL DEFAULT '0',
    smtp_host varchar(64) DEFAULT NULL,
    smtp_port int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    ALTER TABLE ident_switch
    ADD PRIMARY KEY (id),
    ADD UNIQUE KEY user_id_label (user_id,label),
    ADD KEY IX_ident_switch_user_id (user_id),
    ADD KEY IX_ident_switch_iid (iid);

    ALTER TABLE ident_switch
    MODIFY id int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

    ALTER TABLE ident_switch
    ADD CONSTRAINT fk_identity_id FOREIGN KEY (iid) REFERENCES identities (identity_id) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE;
    COMMIT;

    but the Script did not save anyhow.
    now iam at the end 😃

  3. Boris Gulay repo owner

    There should be personal log file of the plugin. Usually /var/log/roundcube/ident_switch

    Also check that new table esists in database and has correct assecc rights. It could be an issue if you have created it under your account, not roundcube.

  4. Gregory Odom

    At install, I get an error when creating the table in Postgres:

    ERROR: [7] ERROR: column "port" does not exist (SQL Query: CREATE TABLE ident_switch …

    imap_port integer CHECK(port > 0 AND port <= 65535), …

    The check should have imap_port instead of port. smtp_port has the same issue.

  5. yb

    I tried also with a MySQL database : I have the same SQL error at the import of mysql.initial.sql

    Request:

    label varchar(32), flags int NOT NULL DEFAULT 0, smtp_host varchar(64), smtp_port int CHECK(smtp_port > 0 AND smtp_port <= 65535), drafts_mbox varchar(64), sent_mbox varchar(64), junk_mbox varchar(64), trash_mbox varchar(64), UNIQUE KEY user_id_label (user_id, label), CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT fk_identity_id FOREIGN KEY (iid) REFERENCES identities(identity_id) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY(id), INDEX IX_ident_switch_user_id (user_id), INDEX IX_ident_switch_iid (iid) );

    MySQL replies :

    #1064 - Syntax error near 'label
    varchar(32),
    flags
    int
    NOT NULL
    DEFAULT 0,
    smtp_host
    varcha' at line 1

    Thanks for help 😀

  6. Robert Koszewski

    I found a fix for MariaDB.

    It seems that all the values (id, user_id, iid, username,..) they need to be quoted with “`”.

    CREATE TABLE IF NOT EXISTS `ident_switch`
    (
    `id`
    int(10) UNSIGNED
    NOT NULL
    AUTO_INCREMENT,
    `user_id`
    int(10) UNSIGNED
    NOT NULL,
    `iid`

    I guess MySQL is more permissive with that.

  7. Log in to comment