about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-04-03 22:10:58 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-04-03 22:10:58 +0200
commit3370fd5f705987aa92e613ee914d613ffa247e2c (patch)
tree1f7d12725fb04a5d4fac37095ac01007ab9c0e3e
parent8c8a4bd4227c7b8034f4d120e681c8edd2807adc (diff)
downloadmblaze-3370fd5f705987aa92e613ee914d613ffa247e2c.tar.gz
mblaze-3370fd5f705987aa92e613ee914d613ffa247e2c.tar.xz
mblaze-3370fd5f705987aa92e613ee914d613ffa247e2c.zip
blaze822: blaze822_addr: don't force add space before quoted words
-rw-r--r--blaze822.c2
-rwxr-xr-xt/1501-maddr-regress.t7
2 files changed, 6 insertions, 3 deletions
diff --git a/blaze822.c b/blaze822.c
index 6a5c305..0434d89 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -277,8 +277,6 @@ blaze822_addr(char *s, char **dispo, char **addro)
 			if (memchr(tok, '@', c - tok))
 				not_addr = 1;  // @ inside "" is never an addr
 
-			if (tc != ttok)
-				tc += safe_append_space(ttok, sizeof ttok);
 			tc += safe_append(ttok, sizeof ttok, tok, c);
 		} else if (*s == '(') {
 			char *z = skip_comment(s);
diff --git a/t/1501-maddr-regress.t b/t/1501-maddr-regress.t
index 3f638b5..37b592a 100755
--- a/t/1501-maddr-regress.t
+++ b/t/1501-maddr-regress.t
@@ -1,7 +1,7 @@
 #!/bin/sh
 cd ${0%/*}
 . ./lib.sh
-plan 27
+plan 31
 
 check_addr() {
   printf "From: %s\n" "$1" | check_test "parse $1" = "$2" "maddr /dev/stdin"
@@ -41,3 +41,8 @@ check_addr 'foo@[::1] (ipv6)' 'ipv6 <foo@[::1]>'
 check_addr '<Foo Bar <foobar@qux.com>' 'foobar@qux.com'
 check_addr '"abc@def"@ghi' ''
 check_addr '"foo@" <bar.com foo@bar.com>' '"foo@" <bar.comfoo@bar.com>'
+
+check_addr 'test."test"@example.org' 'test.test@example.org'
+check_addr '<test."test"@example.org>' 'test.test@example.org'
+check_addr 'test"test"@example.org' 'testtest@example.org'
+check_addr '<test"test"@example.org>' 'testtest@example.org'