On Thu, Nov 21, 2013 at 08:03:28PM +0100, Gilles Chehade wrote:
> Hi,
> 
> Can you open a ticket for a feature request on our bug tracker ?
> 
> This is certainly a feature that can be merged, however it won't be part of
> the upcoming major release ;-)
> 

While at it...

> int
> table_mailaddr_match(const char *s1, const char *s2)
> {
>    struct mailaddr m1;
>    struct mailaddr m2;
>
>    if (! text_to_mailaddr(&m1, s1))
>       return 0;
>    if (! text_to_mailaddr(&m2, s2))
>       return 0;
>

You can replace this whole part:

>    if (m2.domain[0] && m2.domain[0] == '*') {
>       size_t m1_len = strlen(m1.domain);
>       size_t m2_len = strlen(m2.domain);
>
>       if (m1_len < m2_len - 1)
>          return 0;
>       if (strcasecmp(&m1.domain[m1_len - m2_len + 1], &m2.domain[1]))
>          return 0;
>    } else if (strcasecmp(m1.domain, m2.domain))
>       return 0;
>

with:

     if (! table_domain_match(m1.domain, m2.domain))
        return 0;

as our domain matcher in static tables is already '*'-aware ;-)


>    if (m2.user[0])
>       if (strcasecmp(m1.user, m2.user))
>          return 0;
>    return 1;
> }


-- 
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

-- 
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to