From: Robert Schetterer on
Am 29.01.2010 17:24, schrieb Brian Evans - Postfix List:
> On 1/29/2010 11:02 AM, Robert Schetterer wrote:
>> Am 29.01.2010 16:58, schrieb Robert Schetterer:
>>
>>>
>>> things with union work but , the problem
>>> seems to be the double result of equal entries
>>>
>>> query = SELECT DISTINCT concat('@', domain,' ', username) username FROM
>>> domain_admins WHERE username='%s'
>>> AND domain = '%d' UNION SELECT username FROM mailbox WHERE username='%s'
>>> AND active = 1
>>>
>>> i.e
>>>
>>> postmap -q "robert(a)schetterer.org"
>>> mysql:/etc/postfix/mysql_sasl_login_maps-test.cf
>>> @schetterer.org robert(a)schetterer.org,robert(a)schetterer.org
>>>
>>> equal doubles seems to be accepted with postfix sasl map
>>>
>> sorry here seems not to be accepted
>>
>>
>>> so i like to supress the the second result if first matched allready
>>> any idea, destinct dousnt seem to help
>>>
> Try adding LIMIT 1 to the end. This will give only one result in the
> precedence specified by the query when used like in
> http://dev.mysql.com/doc/refman/5.0/en/union.html
>
> (SELECT concat('@', domain,' ', username) username FROM
> domain_admins WHERE username='%s'
> AND domain = '%d') UNION (SELECT username FROM mailbox WHERE username='%s'
> AND active = 1)
> LIMIT 1
>
>
> The above would return a single row with domain_admins overruling what
> is in mailbox
>

jep that query works

postmap -q "robert(a)schetterer.org"
mysql:/etc/postfix/mysql_sasl_login_maps-test.cf
@schetterer.org robert(a)schetterer.org

but sasl_map does not work yet like expected

<monika(a)schetterer.org>: Sender address rejected: not owned by user
robert(a)schetterer.org; from=<monika(a)schetterer.org>

so i have to look what now wrong

--
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria

From: Victor Duchovni on
On Fri, Jan 29, 2010 at 05:57:30PM +0100, Robert Schetterer wrote:

> jep that query works
>
> postmap -q "robert(a)schetterer.org"
> mysql:/etc/postfix/mysql_sasl_login_maps-test.cf
> @schetterer.org robert(a)schetterer.org

This is the wrong result format. The value retuned must be a comma
separated list of SASL login names. Lose the leading "@domain".

>
> but sasl_map does not work yet like expected
>
> <monika(a)schetterer.org>: Sender address rejected: not owned by user
> robert(a)schetterer.org; from=<monika(a)schetterer.org>

As expected.

--
Viktor.

P.S. Morgan Stanley is looking for a New York City based, Senior Unix
system/email administrator to architect and sustain our perimeter email
environment. If you are interested, please drop me a note.

From: Robert Schetterer on
Am 29.01.2010 18:12, schrieb Victor Duchovni:
> On Fri, Jan 29, 2010 at 05:57:30PM +0100, Robert Schetterer wrote:
>
>> jep that query works
>>
>> postmap -q "robert(a)schetterer.org"
>> mysql:/etc/postfix/mysql_sasl_login_maps-test.cf
>> @schetterer.org robert(a)schetterer.org
>
> This is the wrong result format. The value retuned must be a comma
> separated list of SASL login names. Lose the leading "@domain".
>
>>
>> but sasl_map does not work yet like expected
>>
>> <monika(a)schetterer.org>: Sender address rejected: not owned by user
>> robert(a)schetterer.org; from=<monika(a)schetterer.org>
>
> As expected.
>

sorry viktor youre right , reading the faqs i am confused now

i have another server with ...

smtpd_sender_restrictions = reject_non_fqdn_sender,
check_sender_access
hash:/etc/postfix/sender_access,
#check_client_access
hash:/etc/postfix/client_zentrale_access,
permit_mynetworks,
reject_unlisted_sender,
reject_sender_login_mismatch,
permit_sasl_authenticated,
....

smtpd_sender_login_maps = hash:/etc/postfix/sasl_senders

pico /etc/postfix/sasl_senders

@domain.de username

which works as desired


--
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria

From: Victor Duchovni on
On Fri, Jan 29, 2010 at 06:30:45PM +0100, Robert Schetterer wrote:

> smtpd_sender_login_maps = hash:/etc/postfix/sasl_senders
>
> pico /etc/postfix/sasl_senders
>
> @domain.de username
>
> which works as desired

As documented, in indexed files the first non-whitespace token is the
lookup *key*, and the remainder of the (possibly "folded") line is
the *value*.

$ postmap -q "@domain.de" hash:/etc/postfix/sasl_senders
username

--
Viktor.

P.S. Morgan Stanley is looking for a New York City based, Senior Unix
system/email administrator to architect and sustain our perimeter email
environment. If you are interested, please drop me a note.

From: Robert Schetterer on
Am 29.01.2010 18:36, schrieb Victor Duchovni:
> On Fri, Jan 29, 2010 at 06:30:45PM +0100, Robert Schetterer wrote:
>
>> smtpd_sender_login_maps = hash:/etc/postfix/sasl_senders
>>
>> pico /etc/postfix/sasl_senders
>>
>> @domain.de username
>>
>> which works as desired
>
> As documented, in indexed files the first non-whitespace token is the
> lookup *key*, and the remainder of the (possibly "folded") line is
> the *value*.
>
> $ postmap -q "@domain.de" hash:/etc/postfix/sasl_senders
> username
>
sorry viktor, i dont understand, perhaps my english leaks here
would you like to say that this cannot be done with sql?

--
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria

First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: relay help
Next: From: header correctness