OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Address extensions in MySQL querys

From: Victor Duchovni (Victor.DuchovniMorganStanley.com)
Date: Sun Dec 10 2006 - 09:54:03 CST


On Sun, Dec 10, 2006 at 12:57:22PM +0100, Mark Plomer wrote:

>
> >>I want to use the address extension (which results from
> >>recepient_delimiter)
> >>in the query of the virtual_mailbox_maps, which connects to a MySQL
> >>database.
> >>I found only the options "%d", "%s" and "%u", which are all with stripped
> >>address-extension.
> >
> >No, %u and %s use both the extended address and then the full address.
> If I set "recepient_delimiter = +"
> and the recipient is "user+spamexample.com" then
> %d = example.com
> %u = user
> %s = userexample.com

This is not accurate, you get two queries, with the first %u is
"user+spam" and if this finds nothing, in the second %u is "user".

> and I have no possibility to access the "spam" address extension.
> This feature would be very helpful. Is there any other possibility?

From virtual(8):

    The search order is as follows. The search stops upon the
    first successful lookup.

        o When the recipient has an optional address exten-
               sion the user+extensiondomain.tld address is
               looked up first.

               With Postfix versions before 2.1, the optional
               address extension is always ignored.

        o The userdomain.tld address, without address exten-
               sion, is looked up next.

        o Finally, the recipient domain is looked up.

    When the table is provided via other means such as NIS,
    LDAP or SQL, the same lookups are done as for ordinary
    indexed files.

--
        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:majordomopostfix.org?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.