Discussion:
smtpd_sender_login_maps problem
(too old to reply)
Paul
2016-08-03 13:21:25 UTC
Permalink
Hello

I am having problems with creating a new mysql lookup statement which
queries 2 tables
for valid sasl login names

The new query is

cat peq.sql

SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address = sasl_aliases.address AND aliases.address =
'***@address.com';


***@cedar:~# mysql -u mailuser -p maildb <peq.sql
Enter password:
username1 username2

Which is what I believe I need ie returning a white spaced list of valid
login names for ***@address.com.

However postfix coughs and fails with this query. log shows

Aug 3 14:17:46 larch postfix/submit/smtpd[21172]: fatal:
/etc/postfix/mysql/new
.cf, line 4: missing '=' after attribute name: "SELECT
aliases.id,sasl_aliases.i
d FROM sasl_aliases,aliases WHERE aliases.address=sasl_aliases.address
AND alias
es.address='%s'"


Any pointers or suggestions

Paul Enlund
/dev/rob0
2016-08-03 14:43:22 UTC
Permalink
Post by Paul
I am having problems with creating a new mysql lookup statement
which queries 2 tables for valid sasl login names
The new query is
cat peq.sql
SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address = sasl_aliases.address AND aliases.address =
That's fine I suppose, but it's not valid syntax for a Postfix
mysql_table(5) query file.
Post by Paul
username1 username2
Which is what I believe I need ie returning a white spaced list of
However postfix coughs and fails with this query. log shows
/etc/postfix/mysql/new.cf, line 4: missing '=' after attribute
name: "SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases
WHERE aliases.address=sasl_aliases.address AND
aliases.address='%s'"
Any pointers or suggestions
http://www.postfix.org/MYSQL_README.html
http://www.postfix.org/mysql_table.5.html

Your query file would generally have these lines:
user = ...
password = ...
dbname = ...

and then your query:

query = SELECT aliases.id,sasl_aliases.id
FROM sasl_aliases,aliases
WHERE aliases.address=sasl_aliases.address AND
aliases.address='%s'
--
http://rob0.nodns4.us/
Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
Paul
2016-08-03 14:51:30 UTC
Permalink
Post by /dev/rob0
Post by Paul
I am having problems with creating a new mysql lookup statement
which queries 2 tables for valid sasl login names
The new query is
cat peq.sql
SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address = sasl_aliases.address AND aliases.address =
That's fine I suppose, but it's not valid syntax for a Postfix
mysql_table(5) query file.
Post by Paul
username1 username2
Which is what I believe I need ie returning a white spaced list of
However postfix coughs and fails with this query. log shows
/etc/postfix/mysql/new.cf, line 4: missing '=' after attribute
name: "SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases
WHERE aliases.address=sasl_aliases.address AND
aliases.address='%s'"
Any pointers or suggestions
http://www.postfix.org/MYSQL_README.html
http://www.postfix.org/mysql_table.5.html
user = ...
password = ...
dbname = ...
query = SELECT aliases.id,sasl_aliases.id
FROM sasl_aliases,aliases
WHERE aliases.address=sasl_aliases.address AND
aliases.address='%s'
'The complete file is

# /etc/posfix/mysql/new.cf

user=mailuser
password=xxxxxxxx
dbname=maildb
SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address=sasl_aliases.address AND aliases.address='%s'
hosts=unix:/chroot/web/var/run/mysqld/mysqld.sock

which causes


Aug 3 15:49:16 larch postfix/submit/smtpd[4384]: fatal:
/etc/postfix/mysql/new.cf,

line 4: missing '=' after attribute name: "SELECT
aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address=sasl_aliases.address AND aliases.address='%s'"

PE
Jan Ceuleers
2016-08-03 15:44:25 UTC
Permalink
Post by Paul
line 4: missing '=' after attribute name: "SELECT
aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address=sasl_aliases.address AND aliases.address='%s'"
You might have gone over this so many times that you're missing it:

You need to prepend "query = " to the SELECT statement on line 4 in
/etc/posfix/mysql/new.cf
Noel Jones
2016-08-03 15:44:47 UTC
Permalink
Post by Paul
'The complete file is
# /etc/posfix/mysql/new.cf
user=mailuser
password=xxxxxxxx
dbname=maildb
SELECT aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address=sasl_aliases.address AND aliases.address='%s'
hosts=unix:/chroot/web/var/run/mysqld/mysqld.sock
query = SELECT ...



-- Noel Jones
Paul
2016-08-03 17:41:40 UTC
Permalink
Blushing thanks for the 2nd set of eyes spotting the obvious.

Trouble now is the query only returns id results if the address is in
both tables.
So back to the drawing mysql drawing board.

PE
Post by Jan Ceuleers
Post by Paul
line 4: missing '=' after attribute name: "SELECT
aliases.id,sasl_aliases.id FROM sasl_aliases,aliases WHERE
aliases.address=sasl_aliases.address AND aliases.address='%s'"
You need to prepend "query = " to the SELECT statement on line 4 in
/etc/posfix/mysql/new.cf
Phil Stracchino
2016-08-03 17:53:44 UTC
Permalink
Post by Paul
Blushing thanks for the 2nd set of eyes spotting the obvious.
Trouble now is the query only returns id results if the address is in
both tables.
So back to the drawing mysql drawing board.
What do your tables look like?
--
Phil Stracchino
Babylon Communications
***@caerllewys.net
***@co.ordinate.org
Landline: 603.293.8485
Paul
2016-08-03 18:14:26 UTC
Permalink
Post by Phil Stracchino
Post by Paul
Blushing thanks for the 2nd set of eyes spotting the obvious.
Trouble now is the query only returns id results if the address is in
both tables.
So back to the drawing mysql drawing board.
What do your tables look like?
sasl_aliases | CREATE TABLE `sasl_aliases` (
`address` text NOT NULL,
`id` varchar(128) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1

aliases | CREATE TABLE `aliases` (
`address` varchar(255) NOT NULL DEFAULT '',
`goto` varchar(255) DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
`id` varchar(128) NOT NULL DEFAULT '',
PRIMARY KEY (`address`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Loading...