diff options
author | 2012-07-11 17:20:00 +0000 | |
---|---|---|
committer | 2012-07-11 17:20:00 +0000 | |
commit | e028fc42ceb07f37994002004d2e6192485044eb (patch) | |
tree | 3d787684b48e02fc52e49f4274e064fd9a46a8cb | |
parent | fix position and formatting of %U (diff) | |
download | wireguard-openbsd-e028fc42ceb07f37994002004d2e6192485044eb.tar.xz wireguard-openbsd-e028fc42ceb07f37994002004d2e6192485044eb.zip |
Don't respect RFC 5322, that allows some crazy characters in email
localpart, like !#$&'*/=?^`{|}~ ... and all the other ones that
can be double quoted, just refuse them.
ok gilles@ eric@
-rw-r--r-- | usr.sbin/smtpd/util.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c index e6bc282e943..d1f4a7138b9 100644 --- a/usr.sbin/smtpd/util.c +++ b/usr.sbin/smtpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.63 2012/07/10 16:11:43 chl Exp $ */ +/* $OpenBSD: util.c,v 1.64 2012/07/11 17:20:00 chl Exp $ */ /* * Copyright (c) 2000,2001 Markus Friedl. All rights reserved. @@ -259,7 +259,11 @@ hostname_match(char *hostname, char *pattern) int valid_localpart(const char *s) { -#define IS_ATEXT(c) (isalnum((int)(c)) || strchr("!#$%&'*+-/=?^_`{|}~", (c))) +/* + * RFC 5322 defines theses characters as valid: !#$%&'*+-/=?^_`{|}~ + * some of them are potentially dangerous, and not so used after all. + */ +#define IS_ATEXT(c) (isalnum((int)(c)) || strchr("%+-_", (c))) nextatom: if (! IS_ATEXT(*s) || *s == '\0') return 0; |