about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--man/mblaze-profile.58
-rw-r--r--mmime.c2
-rw-r--r--mseq.c12
-rwxr-xr-xt/1000-mmime.t18
4 files changed, 31 insertions, 9 deletions
diff --git a/man/mblaze-profile.5 b/man/mblaze-profile.5
index d9aaad5..d0594f3 100644
--- a/man/mblaze-profile.5
+++ b/man/mblaze-profile.5
@@ -1,4 +1,4 @@
-.Dd June 18, 2021
+.Dd January 27, 2024
 .Dt MBLAZE-PROFILE 5
 .Os
 .Sh NAME
@@ -60,11 +60,13 @@ will save messages in this maildir after sending.
 .It Li Drafts\&:
 If set,
 .Xr mcom 1
-will create draft messages in this maildir (defaults to Outbox). 
+will create draft messages in this maildir (defaults to Outbox).
 .It Li Reply-From\&:
-A comma-separated list of display name and mail address pairs, formatted like this:
+A comma-separated list of display name and mail address pairs,
+formatted like this:
 .Dl Li Primary Name <myname1@domain1>, Name v.2 <myname2@domain2>, \[dq]Name, My Third\[dq] <myname3@domain3>, ...
 The first of these that appears in the
+.Li Delivered-To\&: ,
 .Li To\&: ,
 .Li Cc\&: ,
 or
diff --git a/mmime.c b/mmime.c
index 6334569..b521efc 100644
--- a/mmime.c
+++ b/mmime.c
@@ -347,7 +347,7 @@ print_header(char *line) {
 		if (!highbit) {
 			if (e-s >= 998)
 				goto force_qp;
-			if (e-s >= 78 - linelen) {
+			if (e-s >= 78 - linelen && linelen > 0) {
 				// wrap in advance before long word
 				printf("\n");
 				linelen = 0;
diff --git a/mseq.c b/mseq.c
index f63aaae..519284e 100644
--- a/mseq.c
+++ b/mseq.c
@@ -317,13 +317,10 @@ usage:
 	if (optind == argc && !isatty(0))
 		return stdinmode();
 
-	char *seq = blaze822_seq_open(0);
-	if (!seq)
-		return 1;
-
 	int i;
 	char *f;
 	char *a;
+	char *seq = 0;
 
 	if (optind == argc) {
 		a = ":";
@@ -337,6 +334,13 @@ hack:
 			printf("%s\n", a);
 			continue;
 		}
+
+		if (!seq) {
+			seq = blaze822_seq_open(0);
+			if (!seq)
+				return 1;
+		}
+
 		struct blaze822_seq_iter iter = { 0 };
 		while ((f = blaze822_seq_next(seq, a, &iter))) {
 			char *s = f;
diff --git a/t/1000-mmime.t b/t/1000-mmime.t
index ca9dd82..faad46f 100755
--- a/t/1000-mmime.t
+++ b/t/1000-mmime.t
@@ -2,7 +2,7 @@
 cd ${0%/*}
 . ./lib.sh
 
-plan 19
+plan 21
 
 cat <<EOF >tmp
 References: <aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@a> <bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@b> <ccccccccccccccccccccccccccccccc@c>
@@ -134,3 +134,19 @@ EOF
 
 check 'body lines longer than 78 characters needs MIME formatting' '! mmime -c <tmp2'
 check 'MBLAZE_RELAXED_MIME allows body lines longer than 78 characters' 'MBLAZE_RELAXED_MIME= mmime -c <tmp2'
+
+cat <<EOF >tmp2
+DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1710013705;
+	s=s1; d=tuta.io;
+	h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=Jr8DQlZ7RwdJv94m7ZT/v+cv/WFsgjxpMRsHvnNfgGY=;
+	b=NXRl0YxYtVsWrR8v7tVKnvsnCSrBqqaf2h3m8OVGlzG0OqMqGcWg7fVk6x4nTYV+
+	+05afZrGfIwcfFwIe/LLvT0d3/12t4+cs/FQvmEcFUN+n2buQwt5sn8f76UUlvNMrGz
+	Xbq8HAdwhA364yWABa7DrF1EGysC8bEDJcCtSs/Wz3TL2A/MEeItEF+VijtgWUwoOwn
+	rFKkCg5Df+IOd4gEBS/KYLbzcMB1dvqy+ut2LA2+NZpzJQPgbJzWAYieT9KYgoS+hKS
+	5FfknNT+hKZz18IBEWH1UWbI+CcLRR8Sr80x2DZUKq8ryC5RmV5/uAc5Up03b/KZGRU
+	NsiBAQCx3w==
+EOF
+
+check 'header words longer then 78 characters do not cause empty lines (#257)' 'mmime < tmp2 | awk "NR < 5 && length == 0 { exit 1 }"'
+
+check 'header words longer then 78 characters are printed on their own line' 'mmime < tmp2 |grep "^[ 	]*h=From.*Sender;$"'