diff options
author | 2020-09-16 11:19:42 +0000 | |
---|---|---|
committer | 2020-11-20 11:14:40 +0100 | |
commit | 9b132f4c62e6008d6fc25b5f946835a25c1b0cae (patch) | |
tree | 534a1e3cf65f57a7070ae664472a0910c27647f1 | |
parent | Fix handling of user names containing '@' symbols. (diff) | |
download | OpenSMTPD-9b132f4c62e6008d6fc25b5f946835a25c1b0cae.tar.xz OpenSMTPD-9b132f4c62e6008d6fc25b5f946835a25c1b0cae.zip |
Add the admd keyword. This can be used by filters interested in the
Authentication-Results header.
OK giovanni@
-rw-r--r-- | usr.sbin/smtpd/lka_filter.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/parse.y | 21 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.conf.5 | 9 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 4 |
4 files changed, 32 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/lka_filter.c b/usr.sbin/smtpd/lka_filter.c index 2dc66057..7931ede4 100644 --- a/usr.sbin/smtpd/lka_filter.c +++ b/usr.sbin/smtpd/lka_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_filter.c,v 1.62 2020/04/24 11:34:07 eric Exp $ */ +/* $OpenBSD: lka_filter.c,v 1.63 2020/09/16 11:19:42 martijn Exp $ */ /* * Copyright (c) 2018 Gilles Chehade <gilles@poolp.org> @@ -212,6 +212,8 @@ lka_proc_config(struct processor_instance *pi) io_printf(pi->io, "config|subsystem|smtp-in\n"); if (pi->subsystems & FILTER_SUBSYSTEM_SMTP_OUT) io_printf(pi->io, "config|subsystem|smtp-out\n"); + io_printf(pi->io, "config|admd|%s\n", + env->sc_admd != NULL ? env->sc_admd : env->sc_hostname); io_printf(pi->io, "config|ready\n"); } diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index db5be747..a4afed97 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.277 2020/02/24 23:54:27 millert Exp $ */ +/* $OpenBSD: parse.y,v 1.279 2020/09/16 11:19:42 martijn Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -179,7 +179,7 @@ typedef struct { %} -%token ACTION ALIAS ANY ARROW AUTH AUTH_OPTIONAL +%token ACTION ADMD ALIAS ANY ARROW AUTH AUTH_OPTIONAL %token BACKUP BOUNCE BYPASS %token CA CERT CHAIN CHROOT CIPHERS COMMIT COMPRESSION CONNECT %token DATA DATA_LINE DHE DISCONNECT DOMAIN @@ -215,6 +215,7 @@ grammar : /* empty */ | grammar include '\n' | grammar varset '\n' | grammar bounce '\n' + | grammar admd '\n' | grammar ca '\n' | grammar mda '\n' | grammar mta '\n' @@ -316,6 +317,21 @@ BOUNCE WARN_INTERVAL { ; +admd: +ADMD STRING { + size_t i; + + for (i = 0; $2[i] != '\0'; i++) { + if (!isprint($2[i])) { + yyerror("not a valid admd"); + free($2); + YYERROR; + } + } + conf->sc_admd = $2; +}; + + ca: CA STRING { char buf[HOST_NAME_MAX+1]; @@ -2607,6 +2623,7 @@ lookup(char *s) /* this has to be sorted always */ static const struct keywords keywords[] = { { "action", ACTION }, + { "admd", ADMD }, { "alias", ALIAS }, { "any", ANY }, { "auth", AUTH }, diff --git a/usr.sbin/smtpd/smtpd.conf.5 b/usr.sbin/smtpd/smtpd.conf.5 index 23acd7f7..d117b3c4 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.252 2020/09/14 13:06:51 millert Exp $ +.\" $OpenBSD: smtpd.conf.5,v 1.253 2020/09/16 11:19:42 martijn Exp $ .\" .\" Copyright (c) 2008 Janne Johansson <jj@openbsd.org> .\" Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net> @@ -17,7 +17,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" -.Dd $Mdocdate: September 14 2020 $ +.Dd $Mdocdate: September 16 2020 $ .Dt SMTPD.CONF 5 .Os .Sh NAME @@ -321,6 +321,11 @@ which is useful on machines with multiple interfaces. If the list contains more than one address, all of them are used in such a way that traffic is routed as efficiently as possible. .El +.It Ic admd Ar authservid +The Administrative Management Domain this mailserver belongs to. +The authservid will be forwarded to filters using it to identify or mark +authentication-results headers. +If omitted it defaults to the server name. .It Ic bounce Cm warn-interval Ar delay Op , Ar delay ... Send warning messages to the envelope sender when temporary delivery failures cause a message to remain on the queue for longer than diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 4385f747..237700c5 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.656 2020/04/08 07:30:44 eric Exp $ */ +/* $OpenBSD: smtpd.h,v 1.657 2020/09/16 11:19:42 martijn Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -650,6 +650,8 @@ struct smtpd { char *sc_srs_key; char *sc_srs_key_backup; int sc_srs_ttl; + + char *sc_admd; }; #define TRACE_DEBUG 0x0001 |