On 06/12/14 18:13, Guenther Niess wrote:
> This patch adds support for LDAP mail address tables which are used
> by smtpd.conf to list recipients of specified domains. I used it
> to configure a backup mx server. Seems to work fine.

Sorry. I accidentally sent the wrong patch, I used it with the OpenBSD
stable branch. Now here is the one I wanted to send based on CVS Head.


Index: usr.sbin/smtpd/table_ldap.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/table_ldap.c,v
retrieving revision 1.10
diff -u -p -r1.10 table_ldap.c
--- usr.sbin/smtpd/table_ldap.c 10 Jun 2014 16:43:46 -0000      1.10
+++ usr.sbin/smtpd/table_ldap.c 12 Jun 2014 13:07:45 -0000
@@ -142,6 +142,7 @@ table_ldap_check(int service, const char
        case K_DOMAIN:
        case K_CREDENTIALS:
        case K_USERINFO:
+       case K_MAILADDR:
                return ldap_run_query(service, key, NULL, 0);
        default:
                return (-1);
@@ -156,6 +157,7 @@ table_ldap_lookup(int service, const cha
        case K_DOMAIN:
        case K_CREDENTIALS:
        case K_USERINFO:
+       case K_MAILADDR:
                return ldap_run_query(service, key, dst, sz);
        default:
                return (-1);
@@ -364,6 +366,12 @@ ldap_config(void)
                else if (!strcmp(key, "userinfo_attributes"))
                        ldap_parse_attributes(queries[LDAP_USERINFO].attrs,
                            key, value, 4);
+
+               else if (!strcmp(key, "mailaddr_filter"))
+                       read_value(&queries[LDAP_MAILADDR].filter, key, value);
+               else if (!strcmp(key, "mailaddr_attributes"))
+                       ldap_parse_attributes(queries[LDAP_MAILADDR].attrs,
+                           key, value, 1);
                else
                        log_warnx("warn: table-ldap: bogus entry \"%s\"", key);
        }
@@ -527,6 +535,7 @@ ldap_run_query(int type, const char *key
                }
                break;
        case K_DOMAIN:
+       case K_MAILADDR:
                if (strlcpy(dst, res[0][0], sz) >= sz)
                        ret = -1;
                break;

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

Reply via email to