summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/aliases.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-11-03 20:55:24 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-11-03 20:55:24 +0000
commit2879f4cbbd7e34b53724be947402b12e4a609c48 (patch)
treead46fefafb80fb9cc57959c8a5cc850f348e869a /usr.sbin/smtpd/aliases.c
parentf1e456032facee63cf671bfe73b7c3d0eebced64 (diff)
this commit removes the hardcoded special "aliases" map and brings support
for multiple aliases maps that can be attached at the rule level. with it, you can for example define different aliases maps for different domains or different aliases maps for the same domain depending on the client source: map "localiases" { source db "/etc/mail/localiases.db" } map "netaliases" { source db "/etc/mail/netaliases.db" } accept from 192.168.0.0/16 for local alias "localiases" deliver to mbox accept from all for local alias "netaliases" deliver to mbox idea discussed with jacekm@ and various other hackers, diff contains some bug fixes too which were not part of the original diff. man page follows very shortly ... make clean & flush queue !
Diffstat (limited to 'usr.sbin/smtpd/aliases.c')
-rw-r--r--usr.sbin/smtpd/aliases.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c
index 965dfbd1006..0285c6cbdfb 100644
--- a/usr.sbin/smtpd/aliases.c
+++ b/usr.sbin/smtpd/aliases.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aliases.c,v 1.24 2009/11/03 19:13:34 gilles Exp $ */
+/* $OpenBSD: aliases.c,v 1.25 2009/11/03 20:55:23 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -42,7 +42,7 @@ int alias_is_filename(struct alias *, char *, size_t);
int alias_is_include(struct alias *, char *, size_t);
int
-aliases_exist(struct smtpd *env, char *username)
+aliases_exist(struct smtpd *env, objid_t mapid, char *username)
{
char buf[MAXLOGNAME];
int ret;
@@ -51,7 +51,7 @@ aliases_exist(struct smtpd *env, char *username)
DB *aliasesdb;
struct map *map;
- map = map_findbyname(env, "aliases");
+ map = map_find(env, mapid);
if (map == NULL)
return 0;
@@ -75,7 +75,7 @@ aliases_exist(struct smtpd *env, char *username)
}
int
-aliases_get(struct smtpd *env, struct aliaseslist *aliases, char *username)
+aliases_get(struct smtpd *env, objid_t mapid, struct aliaseslist *aliases, char *username)
{
char buf[MAXLOGNAME];
int ret;
@@ -88,7 +88,7 @@ aliases_get(struct smtpd *env, struct aliaseslist *aliases, char *username)
struct alias *nextalias;
struct map *map;
- map = map_findbyname(env, "aliases");
+ map = map_find(env, mapid);
if (map == NULL)
return 0;