OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: reject_authenticated_sender_login_mismatch problem

From: mouss (usebsdfree.fr)
Date: Wed Aug 02 2006 - 17:46:41 CDT


pzlist wrote:
> Hi,
>
> I have a small server with unix system users, I found that
> reject_authenticated_sender_login_mismatch disallow me to send email
> from any authenticated user (SASL) when I use:
>
> local_recipient_maps = unix:passwd.byname, $alias_maps
> smtpd_sender_login_maps = $local_recipient_maps

smtpd_sender_login_maps is supposed to say what login matches what email
address. This is hardly true for /etc/passwd and $alias_maps.
>
> procedure reject_auth_sender_login_mismatch try to compare full line
> from /etc/passwd with sasl login
>
> Below patch - that works for me
what works? what are you trying to match? /etc/passwd doesn't contain
email addresses.

>
> Pawel Z
>
>
>
> --- smtpd_check.c.org 2006-07-07 22:32:43.000000000 +0200
> +++ smtpd_check.c 2006-08-01 12:23:51.000000000 +0200
> -3191,6 +3191,7
> char *saved_owners;
> char *cp;
> char *name;
> + char *pos;
> int found = 0;
>
> /*
> -3205,9 +3206,17
> cp = saved_owners = mystrdup(owners);
> while ((name = mystrtok(&cp, RESTRICTION_SEPARATORS)) != 0) {
> if (strcasecmp(state->sasl_username, name) == 0) {
> - found = 1;
> + found = 1;
> break;
> }
> + if ((pos = strchr(name,':')) != NULL)
> + {
> + if (strncasecmp(state->sasl_username, name, pos -
> name) == 0) {
> + found = 1;
> + break;
> + }
> +
> + }
> }
> myfree(saved_owners);
> }
>
>
>