summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd/parse.y')
-rw-r--r--usr.sbin/smtpd/parse.y21
1 files changed, 19 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y
index 3cce0c75054..3d319772c28 100644
--- a/usr.sbin/smtpd/parse.y
+++ b/usr.sbin/smtpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.187 2016/08/30 21:33:58 gilles Exp $ */
+/* $OpenBSD: parse.y,v 1.188 2016/08/31 10:18:08 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -178,7 +178,7 @@ typedef struct {
%token ACCEPT REJECT INCLUDE ERROR MDA FROM FOR SOURCE MTA PKI SCHEDULER
%token ARROW AUTH TLS LOCAL VIRTUAL TAG TAGGED ALIAS FILTER KEY CA DHE
%token AUTH_OPTIONAL TLS_REQUIRE USERBASE SENDER SENDERS MASK_SOURCE VERIFY FORWARDONLY RECIPIENT
-%token CIPHERS RECEIVEDAUTH MASQUERADE SOCKET
+%token CIPHERS RECEIVEDAUTH MASQUERADE SOCKET SUBADDRESSING_DELIM
%token <v.string> STRING
%token <v.number> NUMBER
%type <v.table> table
@@ -848,6 +848,21 @@ relay_via : opt_relay_common relay_via
main : BOUNCEWARN {
memset(conf->sc_bounce_warn, 0, sizeof conf->sc_bounce_warn);
} bouncedelays
+ | SUBADDRESSING_DELIM STRING {
+ if (strlen($2) != 1) {
+ yyerror("subaddressing-delimiter must be one character");
+ free($2);
+ YYERROR;
+ }
+
+ if (isspace((int)*$2) || !isprint((int)*$2) || *$2== '@') {
+ yyerror("subaddressing-delimiter uses invalid character");
+ free($2);
+ YYERROR;
+ }
+
+ conf->sc_subaddressing_delim = $2;
+ }
| QUEUE COMPRESSION {
conf->sc_queue_flags |= QUEUE_COMPRESSION;
}
@@ -1523,6 +1538,7 @@ lookup(char *s)
{ "smtps", SMTPS },
{ "socket", SOCKET },
{ "source", SOURCE },
+ { "subaddressing-delimiter", SUBADDRESSING_DELIM },
{ "table", TABLE },
{ "tag", TAG },
{ "tagged", TAGGED },
@@ -1877,6 +1893,7 @@ parse_config(struct smtpd *x_conf, const char *filename, int opts)
(void)strlcpy(conf->sc_hostname, hostname, sizeof(conf->sc_hostname));
conf->sc_maxsize = DEFAULT_MAX_BODY_SIZE;
+ conf->sc_subaddressing_delim = SUBADDRESSING_DELIMITER;
conf->sc_tables_dict = calloc(1, sizeof(*conf->sc_tables_dict));
conf->sc_rules = calloc(1, sizeof(*conf->sc_rules));