On Tue, Jan 06, 2009 at 10:20:12PM -0000, jeff_homeip wrote:
> I know that it is not a good model for the way postfix requires the
> query,
More stronly, an SQL schema in which multiple data items are stored
concatenated in a single table element is a poor schema regardless
of the application. This violates fundamental principles of database
schema design. Multi-valued elements are stored in separate tables that
are joined to the main table. This is not a Postfix requirement, it is
basic database design.
> but from a logical standpoint, I am trying to this about it
> as which addresses is a user allowed to send from.
The correct design has a address table which links address objects to user
objects, and a user table which holds attribtues of users. To discover
the addresses of a user, join the two tables. Implement appropriate
indices and forein keys to make the expected queries efficient.
> This makes sense
> when you think about a user having e-mail service through my server,
> and using that to send e-mail from another unrelated valid address then
> he/she owns. (validating that is also important, but not in the scope
> of this issue).
> So I want to associate valid from addresses with the user, not the other
> way around.
In a correct SQL schema the question is moot, SQL stores relation tuples,
there is no notion of which is the primary element in a relation.
x R y <=> row (x,y) is present in table R
> I understand fully the point of view that postfix takes, asking who is
> allowed to send from this e-mail address (more or less masquerade as
> this e-mail identity), which makes sense also.
Yes, but your schema is poorly designed. A good schema will naturally
support a variety of queries that select ether the "x" values for
which "x R y" is true for a given "y" or just as easily the converse.
> There may be better schema for answering the question I am asking,
> but it sounds from your response (I am assuming, possibly dangerously)
> That there is no way to do what I want to do without creating another
> table in the database, indexed by from address with resuting lists of
> users. Is that correct?
I am claiming that what you can't be done with your existing schema,
perhaps it can. I am claiming that you should change your schema
as soon as you can.
> Why does postfix reject the mail when the mysql query return one or
> several valid SASL users?
To solve such questions, divide and conquer:
- Use a simple indexed file to store the sasl_sender_login table.
Make this work, resolving any issues that you find.
- Once SASL sender validation is working without SQL, create
an SQL query that given verbatim keys from the indexed file,
returns the identical RHS values. Verify with multiple "postmap -q"
tests. Once this works, use SQL in the Postfix configuration.
The above approach allows you to identify and solve the right problem.
--
Viktor.
Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.
To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[email protected]?body=unsubscribe%20postfix-users>
If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.