summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-10-07 17:30:42 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-10-07 17:30:42 +0000
commit622768b2cd479ad6bfdbf3d62078732df052ba87 (patch)
treee4864f38cfd826d0d2d35aaa7cfba850aa0657fb
parent0f84655406a532085f61f8b398fe1c0e2cc7bcaa (diff)
since the bounce code rewrite, we no longer need to perform ruleset match
and aliases resolution on the sender before envelope is written in queue: - mfa_test_mail() no longer calls ruleset_match() - lka_verify_mail() no longer resolves sender and set rule action - lka_resolve_mail() becomes dead code so just kill it ok jacekm@
-rw-r--r--usr.sbin/smtpd/lka.c51
-rw-r--r--usr.sbin/smtpd/mfa.c8
2 files changed, 2 insertions, 57 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index ae051bff729..10214e0480f 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.63 2009/09/03 08:19:13 jacekm Exp $ */
+/* $OpenBSD: lka.c,v 1.64 2009/10/07 17:30:41 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -53,7 +53,6 @@ void lka_dispatch_mta(int, short, void *);
void lka_setup_events(struct smtpd *);
void lka_disable_events(struct smtpd *);
int lka_verify_mail(struct smtpd *, struct path *);
-int lka_resolve_mail(struct smtpd *, struct rule *, struct path *);
int lka_forward_file(struct passwd *);
size_t lka_expand(char *, size_t, struct path *);
int aliases_exist(struct smtpd *, char *);
@@ -738,54 +737,6 @@ lka(struct smtpd *env)
int
lka_verify_mail(struct smtpd *env, struct path *path)
{
- struct rule *r;
-
- r = ruleset_match(env, path, NULL);
- if (r == NULL) {
- path->rule.r_action = A_RELAY;
- return 1;
- }
-
- path->rule = *r;
- if (r->r_action == A_MBOX ||
- r->r_action == A_MAILDIR ||
- r->r_action == A_EXT) {
- lka_resolve_mail(env, r, path);
- return 1;
- }
-
- return 1;
-}
-
-int
-lka_resolve_mail(struct smtpd *env, struct rule *rule, struct path *path)
-{
- char username[MAXLOGNAME];
- struct passwd *pw;
- char *p;
-
- (void)strlcpy(username, path->user, sizeof(username));
-
- for (p = &username[0]; *p != '\0' && *p != '+'; ++p)
- *p = tolower((int)*p);
- *p = '\0';
-
- if (aliases_virtual_exist(env, path))
- path->flags |= F_PATH_VIRTUAL;
- else if (aliases_exist(env, username))
- path->flags |= F_PATH_ALIAS;
- else {
- pw = getpwnam(username);
- if (pw == NULL)
- return 0;
- (void)strlcpy(path->pw_name, pw->pw_name,
- sizeof(path->pw_name));
- if (lka_expand(path->rule.r_value.path,
- sizeof(path->rule.r_value.path), path) >=
- sizeof(path->rule.r_value.path))
- return 0;
- }
-
return 1;
}
diff --git a/usr.sbin/smtpd/mfa.c b/usr.sbin/smtpd/mfa.c
index 6ec5d55f78a..50570c71ab7 100644
--- a/usr.sbin/smtpd/mfa.c
+++ b/usr.sbin/smtpd/mfa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfa.c,v 1.37 2009/09/03 08:19:13 jacekm Exp $ */
+/* $OpenBSD: mfa.c,v 1.38 2009/10/07 17:30:41 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -468,7 +468,6 @@ void
mfa_test_mail(struct smtpd *env, struct message *m)
{
struct submit_status ss;
- struct rule *r;
ss.id = m->id;
ss.code = 530;
@@ -487,11 +486,6 @@ mfa_test_mail(struct smtpd *env, struct message *m)
}
/* Current policy is to allow all well-formed addresses. */
- r = ruleset_match(env, &ss.u.path, NULL);
- if (r == NULL)
- ss.u.path.rule.r_action = A_RELAY;
- else
- ss.u.path.rule = *r;
goto accept;
refuse: