1

Topic: Unable to forward

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7 MY SQL edition
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Trying to create a mail forward.  Need info@mydomain.com to forward to kerry@mydomain.com. 

When using MySQL command on vmail database:

UPDATE alias SET goto='kerry@mydomain.com' WHERE username='info@mydomain.com';

I get the error:

ERROR 1054 (42S22): Unknown column 'username' in 'where clause'

What am I doing wrong?

----

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

2

Re: Unable to forward

qwazi wrote:

ERROR 1054 (42S22): Unknown column 'username' in 'where clause'

SQL table "vmail.alias" doesn't have column "username". It's "address".

3

Re: Unable to forward

Thanks but now I'm getting the same error for 'goto'

When I use SHOW COLUMNS FROM vmail.alias it shows the address column but no goto column. 

I'm still stuck.

4

Re: Unable to forward

Why not follow our tutorial directly?
https://docs.iredmail.org/sql.create.mail.alias.html

5

Re: Unable to forward

I tried that.  It's too vague.  I would be asking a lot more questions.

6

Re: Unable to forward

OK, I tried following tutorial but I get the same error message.  there is no 'goto' column.

Help?

7

Re: Unable to forward

Our tutorial doesn't use "goto" column at all, why did you get the error? What SQL command did you run?

8

Re: Unable to forward

Sorry that wasn't your tutorial.
When using your tutorial I am very confused at the syntax.  Here is what I enter:

mysql> INSERT INTO alias ('info@xxxdomain.com', 'xxxdomain.com', 1);

and I get a syntax error.

9

Re: Unable to forward

mysql> INSERT INTO alias VALUES ('info@xxxdomain.com', 'xxxdomain.com', 1);

tells me Column count doesn't match value count at row 1

10

Re: Unable to forward

You didn't follow our tutorial strictly at all, the sql commands on our tutorial have correct syntax, but you didn't use them. Again:
https://docs.iredmail.org/sql.create.mail.alias.html

Compare your sql commands with the ones on tutorial.

11

Re: Unable to forward

ZhangHuangbin wrote:

You didn't follow our tutorial strictly at all, the sql commands on our tutorial have correct syntax, but you didn't use them. Again:
https://docs.iredmail.org/sql.create.mail.alias.html

Compare your sql commands with the ones on tutorial.

That's why I said initially it's too vague.  I've read that tutorial over and over but I don't understand.  Is the syntax in the tutorial exact?  In other words, should my command look more like this?


INSERT INTO alias (info@xxxdomain.com, xxxdomain.com, active) VALUES ('info@xxxdomain.com', 'xxxdomain.com', 1);


I'm sorry to sound like I'm not following instructions.  Once I understand more about the syntax in your tutorials I'm sure I'll be fine.  I'm new to iredmail but so far I love it.  Just need to understand how to do a few tweaks. 

thanks.

12

Re: Unable to forward

Nevermind.  A little testing and I figured it out.  It's really not complicated once you understand how it was written.  However, if you've never done it before, it's nice to have someone explain it.

Thank you.

13

Re: Unable to forward

You need to understand syntax of SQL command.

The syntax is:

INSERT INTO <table-name> (<column-name>, <column-name>, ...) VALUES (<value-for-first-column>, <value-for-second-column>, ...);

You missed list of column names.