aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--smtpd/lka.c4
-rw-r--r--smtpd/lka_session.c6
-rw-r--r--smtpd/parse.y20
-rw-r--r--smtpd/smtpd.c6
-rw-r--r--smtpd/smtpd.h2
5 files changed, 20 insertions, 18 deletions
diff --git a/smtpd/lka.c b/smtpd/lka.c
index 1c0800fc..0f6cdfcf 100644
--- a/smtpd/lka.c
+++ b/smtpd/lka.c
@@ -472,8 +472,8 @@ lka_imsg(struct mproc *p, struct imsg *imsg)
rule = TAILQ_LAST(env->sc_rules_reload, rulelist);
tmp = env->sc_tables_dict;
env->sc_tables_dict = tables_dict;
- rule->r_users = table_findbyname(imsg->data);
- if (rule->r_users == NULL)
+ rule->r_userbase = table_findbyname(imsg->data);
+ if (rule->r_userbase == NULL)
fatalx("lka: tables inconsistency");
env->sc_tables_dict = tmp;
return;
diff --git a/smtpd/lka_session.c b/smtpd/lka_session.c
index b030887c..678dcda6 100644
--- a/smtpd/lka_session.c
+++ b/smtpd/lka_session.c
@@ -317,7 +317,7 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn)
break;
}
- r = table_lookup(rule->r_users, xn->u.user, K_USERINFO, (void **)&tu);
+ r = table_lookup(rule->r_userbase, xn->u.user, K_USERINFO, (void **)&tu);
if (r == -1) {
log_trace(TRACE_EXPAND, "expand: lka_expand: "
"backend error while searching user");
@@ -418,14 +418,14 @@ lka_submit(struct lka_session *lks, struct rule *rule, struct expandnode *xn)
sizeof(ep->agent.mda.username));
}
- r = table_lookup(rule->r_users, ep->agent.mda.username, K_USERINFO,
+ r = table_lookup(rule->r_userbase, ep->agent.mda.username, K_USERINFO,
(void **)&tu);
if (r <= 0) {
lks->error = (r == -1) ? LKA_TEMPFAIL : LKA_PERMFAIL;
free(ep);
return;
}
- strlcpy(ep->agent.mda.usertable, rule->r_users->t_name,
+ strlcpy(ep->agent.mda.usertable, rule->r_userbase->t_name,
sizeof ep->agent.mda.usertable);
strlcpy(ep->agent.mda.username, tu->username,
sizeof ep->agent.mda.username);
diff --git a/smtpd/parse.y b/smtpd/parse.y
index a8ea2b3f..01a767e6 100644
--- a/smtpd/parse.y
+++ b/smtpd/parse.y
@@ -122,7 +122,7 @@ typedef struct {
%token RELAY BACKUP VIA DELIVER TO MAILDIR MBOX HOSTNAME HELO
%token ACCEPT REJECT INCLUDE ERROR MDA FROM FOR SOURCE
%token ARROW AUTH TLS LOCAL VIRTUAL TAG TAGGED ALIAS FILTER KEY
-%token AUTH_OPTIONAL TLS_REQUIRE USERS SENDER
+%token AUTH_OPTIONAL TLS_REQUIRE USERBASE SENDER
%token <v.string> STRING
%token <v.number> NUMBER
%type <v.table> table
@@ -525,7 +525,9 @@ table : TABLE STRING STRING {
}
;
-keyval : STRING ARROW STRING {
+assign : '=' | ARROW;
+
+keyval : STRING assign STRING {
table->t_type = T_HASH;
table_add(table, $1, $3);
free($1);
@@ -626,11 +628,11 @@ usermapping : alias {
}
;
-userbase : USERS tables {
+userbase : USERBASE tables {
struct table *t = table_find($2);
if (! table_check_use(t, T_DYNAMIC|T_HASH, K_USERINFO)) {
- yyerror("invalid use of table \"%s\" as USERS parameter",
+ yyerror("invalid use of table \"%s\" as USERBASE parameter",
t->t_name);
YYERROR;
}
@@ -715,7 +717,7 @@ relay_as : AS STRING {
;
action : userbase DELIVER TO MAILDIR {
- rule->r_users = table_find($1);
+ rule->r_userbase = table_find($1);
rule->r_action = A_MAILDIR;
if (strlcpy(rule->r_value.buffer, "~/Maildir",
sizeof(rule->r_value.buffer)) >=
@@ -723,7 +725,7 @@ action : userbase DELIVER TO MAILDIR {
fatal("pathname too long");
}
| userbase DELIVER TO MAILDIR STRING {
- rule->r_users = table_find($1);
+ rule->r_userbase = table_find($1);
rule->r_action = A_MAILDIR;
if (strlcpy(rule->r_value.buffer, $5,
sizeof(rule->r_value.buffer)) >=
@@ -732,7 +734,7 @@ action : userbase DELIVER TO MAILDIR {
free($5);
}
| userbase DELIVER TO MBOX {
- rule->r_users = table_find($1);
+ rule->r_userbase = table_find($1);
rule->r_action = A_MBOX;
if (strlcpy(rule->r_value.buffer, _PATH_MAILDIR "/%u",
sizeof(rule->r_value.buffer))
@@ -740,7 +742,7 @@ action : userbase DELIVER TO MAILDIR {
fatal("pathname too long");
}
| userbase DELIVER TO MDA STRING {
- rule->r_users = table_find($1);
+ rule->r_userbase = table_find($1);
rule->r_action = A_MDA;
if (strlcpy(rule->r_value.buffer, $5,
sizeof(rule->r_value.buffer))
@@ -1008,7 +1010,7 @@ lookup(char *s)
{ "tls", TLS },
{ "tls-require", TLS_REQUIRE },
{ "to", TO },
- { "users", USERS },
+ { "userbase", USERBASE },
{ "via", VIA },
{ "virtual", VIRTUAL },
};
diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
index 25ef2e64..6e80c84a 100644
--- a/smtpd/smtpd.c
+++ b/smtpd/smtpd.c
@@ -470,10 +470,10 @@ parent_send_config_lka()
&r->r_mapping->t_name,
sizeof(r->r_mapping->t_name));
}
- if (r->r_users) {
+ if (r->r_userbase) {
m_compose(p_lka, IMSG_CONF_RULE_USERS, 0, 0, -1,
- &r->r_users->t_name,
- sizeof(r->r_users->t_name));
+ &r->r_userbase->t_name,
+ sizeof(r->r_userbase->t_name));
}
}
diff --git a/smtpd/smtpd.h b/smtpd/smtpd.h
index 3dc1b753..1fdcd8f6 100644
--- a/smtpd/smtpd.h
+++ b/smtpd/smtpd.h
@@ -359,7 +359,7 @@ struct rule {
struct mailaddr *r_as;
struct table *r_mapping;
- struct table *r_users;
+ struct table *r_userbase;
time_t r_qexpire;
};