OSEC

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

From: pzlist (pzlistmp.pl)
Date: Wed Aug 02 2006 - 11:07:55 CDT


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

procedure reject_auth_sender_login_mismatch try to compare full line
from /etc/passwd with sasl login

Below patch - that works for me

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);
       }