diff options
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/map_backend.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/parse.y | 13 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.conf.5 | 19 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 4 |
4 files changed, 21 insertions, 19 deletions
diff --git a/usr.sbin/smtpd/map_backend.c b/usr.sbin/smtpd/map_backend.c index f0122f532c0..f3efd1adcbc 100644 --- a/usr.sbin/smtpd/map_backend.c +++ b/usr.sbin/smtpd/map_backend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: map_backend.c,v 1.1 2010/04/21 21:04:29 gilles Exp $ */ +/* $OpenBSD: map_backend.c,v 1.2 2010/04/27 10:17:53 gilles Exp $ */ /* * Copyright (c) 2010 Gilles Chehade <gilles@openbsd.org> @@ -53,7 +53,7 @@ int map_stdio_put(void *, char *, char *); struct map_backend map_backends[] = { { S_DB, map_db_open, map_db_close, map_db_get, map_db_put }, - { S_FILE, + { S_PLAIN, map_stdio_open, map_stdio_close, map_stdio_get, map_stdio_put }, }; diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index 56f43933ad4..67ba39c4f21 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.55 2010/04/20 18:55:01 jacekm Exp $ */ +/* $OpenBSD: parse.y,v 1.56 2010/04/27 10:17:53 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -117,7 +117,7 @@ typedef struct { %token QUEUE INTERVAL SIZE LISTEN ON ALL PORT %token MAP TYPE HASH LIST SINGLE SSL SMTPS CERTIFICATE -%token DNS DB TFILE EXTERNAL DOMAIN CONFIG SOURCE +%token DNS DB PLAIN EXTERNAL DOMAIN CONFIG SOURCE %token RELAY VIA DELIVER TO MAILDIR MBOX HOSTNAME %token ACCEPT REJECT INCLUDE NETWORK ERROR MDA FROM FOR %token ARROW ENABLE AUTH TLS LOCAL VIRTUAL USER TAG ALIAS @@ -350,7 +350,12 @@ maptype : SINGLE { map->m_type = T_SINGLE; } ; mapsource : DNS { map->m_src = S_DNS; } - | TFILE { map->m_src = S_FILE; } + | PLAIN STRING { + map->m_src = S_PLAIN; + if (strlcpy(map->m_config, $2, sizeof(map->m_config)) + >= sizeof(map->m_config)) + err(1, "pathname too long"); + } | DB STRING { map->m_src = S_DB; if (strlcpy(map->m_config, $2, sizeof(map->m_config)) @@ -1025,7 +1030,6 @@ lookup(char *s) { "domain", DOMAIN }, { "enable", ENABLE }, { "external", EXTERNAL }, - { "file", TFILE }, { "for", FOR }, { "from", FROM }, { "hash", HASH }, @@ -1041,6 +1045,7 @@ lookup(char *s) { "mda", MDA }, { "network", NETWORK }, { "on", ON }, + { "plain", PLAIN }, { "port", PORT }, { "queue", QUEUE }, { "reject", REJECT }, diff --git a/usr.sbin/smtpd/smtpd.conf.5 b/usr.sbin/smtpd/smtpd.conf.5 index eccbefac767..f33bbc7532d 100644 --- a/usr.sbin/smtpd/smtpd.conf.5 +++ b/usr.sbin/smtpd/smtpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: smtpd.conf.5,v 1.30 2010/04/22 15:37:45 jmc Exp $ +.\" $OpenBSD: smtpd.conf.5,v 1.31 2010/04/27 10:17:53 gilles Exp $ .\" .\" Copyright (c) 2008 Janne Johansson <jj@openbsd.org> .\" Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net> @@ -16,7 +16,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" -.Dd $Mdocdate: April 22 2010 $ +.Dd $Mdocdate: April 27 2010 $ .Dt SMTPD.CONF 5 .Os .Sh NAME @@ -253,15 +253,9 @@ Maps are used to provide additional configuration information for .Xr smtpd 8 . .Pp .Ar map -may be one of the following: +may be named freely except for the following: .Pp .Bl -tag -width "virtualXXX" -compact -.It aliases -Map queried for mail aliases. -See -.Xr aliases 5 -and -.Xr newaliases 8 . .It secrets Map queried for remote host credentials. See @@ -276,10 +270,13 @@ may be one of the following: Mappings are stored in a file created using .Xr makemap 8 . This is the default type if none is specified. +.It plain +Mappings are stored in a plain text file using the +same format as used to generate +.Xr makemap 8 +mappings. .It dns Not implemented yet. -.It file -Not implemented yet. .El .Pp .Ar source diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 2be94da3244..a818d43cb70 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.181 2010/04/27 09:49:23 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.182 2010/04/27 10:17:53 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -244,7 +244,7 @@ enum map_src { S_NONE, S_DYN, S_DNS, - S_FILE, + S_PLAIN, S_DB, S_EXT }; |