summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2015-10-27 20:14:19 +0000
committergilles <gilles@openbsd.org>2015-10-27 20:14:19 +0000
commit8d60711790bd44483d070b4ddf2038845bc6d723 (patch)
treeaed41b0e0cfb8bc4378ef91efce2530868f13250
parentcalloc -> malloc when the memory is immediately overwritten with memcpy. (diff)
downloadwireguard-openbsd-8d60711790bd44483d070b4ddf2038845bc6d723.tar.xz
wireguard-openbsd-8d60711790bd44483d070b4ddf2038845bc6d723.zip
aliases_virtual_check() has been unneeded for a while
ok jung@, ok sunil@, ok millert@
-rw-r--r--usr.sbin/smtpd/aliases.c48
-rw-r--r--usr.sbin/smtpd/ruleset.c9
-rw-r--r--usr.sbin/smtpd/smtpd.h3
3 files changed, 4 insertions, 56 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c
index 0b260f58cf6..a01cb73a074 100644
--- a/usr.sbin/smtpd/aliases.c
+++ b/usr.sbin/smtpd/aliases.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aliases.c,v 1.66 2015/01/20 17:37:54 deraadt Exp $ */
+/* $OpenBSD: aliases.c,v 1.67 2015/10/27 20:14:19 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -49,7 +49,7 @@ aliases_get(struct expand *expand, const char *username)
mapping = expand->rule->r_mapping;
userbase = expand->rule->r_userbase;
-
+
xlowercase(buf, username, sizeof(buf));
ret = table_lookup(mapping, NULL, buf, K_ALIAS, &lk);
if (ret <= 0)
@@ -76,50 +76,6 @@ aliases_get(struct expand *expand, const char *username)
}
int
-aliases_virtual_check(struct table *table, const struct mailaddr *maddr)
-{
- char buf[LINE_MAX];
- char *pbuf;
- int ret;
-
- if (! bsnprintf(buf, sizeof(buf), "%s@%s", maddr->user,
- maddr->domain))
- return 0;
- xlowercase(buf, buf, sizeof(buf));
-
- /* First, we lookup for full entry: user@domain */
- ret = table_lookup(table, NULL, buf, K_ALIAS, NULL);
- if (ret < 0)
- return (-1);
- if (ret)
- return 1;
-
- /* Failed ? We lookup for username only */
- pbuf = strchr(buf, '@');
- *pbuf = '\0';
- ret = table_lookup(table, NULL, buf, K_ALIAS, NULL);
- if (ret < 0)
- return (-1);
- if (ret)
- return 1;
-
- *pbuf = '@';
- /* Failed ? We lookup for catch all for virtual domain */
- ret = table_lookup(table, NULL, pbuf, K_ALIAS, NULL);
- if (ret < 0)
- return (-1);
- if (ret)
- return 1;
-
- /* Failed ? We lookup for a *global* catch all */
- ret = table_lookup(table, NULL, "@", K_ALIAS, NULL);
- if (ret <= 0)
- return (ret);
-
- return 1;
-}
-
-int
aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr)
{
struct expandnode *xn;
diff --git a/usr.sbin/smtpd/ruleset.c b/usr.sbin/smtpd/ruleset.c
index 120b20505fd..2b9e6855ce0 100644
--- a/usr.sbin/smtpd/ruleset.c
+++ b/usr.sbin/smtpd/ruleset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ruleset.c,v 1.31 2015/01/20 17:37:54 deraadt Exp $ */
+/* $OpenBSD: ruleset.c,v 1.32 2015/10/27 20:14:19 gilles Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
@@ -94,13 +94,6 @@ ruleset_match(const struct envelope *evp)
if ((ret == 0 && !r->r_notdestination) || (ret != 0 && r->r_notdestination))
continue;
- if (r->r_desttype == DEST_VDOM &&
- (r->r_action == A_RELAY || r->r_action == A_RELAYVIA)) {
- if (! aliases_virtual_check(r->r_mapping,
- &evp->rcpt)) {
- return NULL;
- }
- }
goto matched;
}
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index 56c9bcc9218..57a6a7e1ffc 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.479 2015/10/21 16:44:28 jsing Exp $ */
+/* $OpenBSD: smtpd.h,v 1.480 2015/10/27 20:14:19 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -1061,7 +1061,6 @@ struct ca_vrfy_resp_msg {
/* aliases.c */
int aliases_get(struct expand *, const char *);
-int aliases_virtual_check(struct table *, const struct mailaddr *);
int aliases_virtual_get(struct expand *, const struct mailaddr *);
int alias_parse(struct expandnode *, const char *);