Matt Salerno
2005-04-11 21:30:28 UTC
I am looking for some assistance on setting up the
virtual_alias_domains table in SQL. I have read through the postfix
docs, but what I have so far doesn't work. Basically I need to alias a
few different domains, which is much easier than adding a new alias
for every user of every virtual domain. There are many different
virtual domains hosted on this server, with many users per domain, and
my company decided that it wanted to buy the .org and .net for all of
the hosted domain names. Hence my question.
http://www.postfix.org/mysql_table.5.htmlPostfix docs wrote:
When using SQL to store lists such as ..., it is important to
understand that the table must store each list member as a separate
key.
Code:
+----------+-----------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------------------+-------+
| domain | varchar(30) | | PRI | | |
| primary | varchar(30) | | | | |
| added | datetime | | | 0000-00-00 00:00:00 | |
+----------+-----------------+------+-----+---------------------+-------+
So basically, I'll populate the table with:
insert into virtual_alias_domains Values ('foo.org','foo.com',NOW());
Setting, or at least trying to set foo.org as an alias of foo.com.
The next step will be pointing postfix to look at the table.
main.cf:
virtual_alias_domains = mysql:/etc/postfix/sql-virtual_alias_domains.cf
sql-virtual_alias_domains.cf:
user = dbmail
password = mypassword
hosts = localhost
dbname = dbmail
table = virtual_alias_domains
select_field = domain
where_field = primary
When I set all of this up, and I send an e-mail to ***@foo.org I
get the following error in my logs:
[postfix/trivial-rewrite] warning: mysql query failed: You have an
error in your SQL syntax. Check the manual that corresponds to your
MySQL server version for the right syntax to use near 'primary =
'foo.com'' at line 1
[postfix/trivial-rewrite] fatal:
mysql:/etc/postfix/sql-virtual_alias_domains.cf(0,100): table lookup
problem
I'm hoping that someone out there can help me spot the problem.
Thanks,
Matt
virtual_alias_domains table in SQL. I have read through the postfix
docs, but what I have so far doesn't work. Basically I need to alias a
few different domains, which is much easier than adding a new alias
for every user of every virtual domain. There are many different
virtual domains hosted on this server, with many users per domain, and
my company decided that it wanted to buy the .org and .net for all of
the hosted domain names. Hence my question.
http://www.postfix.org/mysql_table.5.htmlPostfix docs wrote:
When using SQL to store lists such as ..., it is important to
understand that the table must store each list member as a separate
key.
Code:
+----------+-----------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------------------+-------+
| domain | varchar(30) | | PRI | | |
| primary | varchar(30) | | | | |
| added | datetime | | | 0000-00-00 00:00:00 | |
+----------+-----------------+------+-----+---------------------+-------+
So basically, I'll populate the table with:
insert into virtual_alias_domains Values ('foo.org','foo.com',NOW());
Setting, or at least trying to set foo.org as an alias of foo.com.
The next step will be pointing postfix to look at the table.
main.cf:
virtual_alias_domains = mysql:/etc/postfix/sql-virtual_alias_domains.cf
sql-virtual_alias_domains.cf:
user = dbmail
password = mypassword
hosts = localhost
dbname = dbmail
table = virtual_alias_domains
select_field = domain
where_field = primary
When I set all of this up, and I send an e-mail to ***@foo.org I
get the following error in my logs:
[postfix/trivial-rewrite] warning: mysql query failed: You have an
error in your SQL syntax. Check the manual that corresponds to your
MySQL server version for the right syntax to use near 'primary =
'foo.com'' at line 1
[postfix/trivial-rewrite] fatal:
mysql:/etc/postfix/sql-virtual_alias_domains.cf(0,100): table lookup
problem
I'm hoping that someone out there can help me spot the problem.
Thanks,
Matt