shithub: Nail

Download patch

ref: fc6ac52c326a5c6af9d14bcfc8cdbe731ac5eae7
parent: a30b92b8f68d91fbda3e01f47a6bb565ce87c27d
author: Ori Bernstein <ori@eigenstate.org>
date: Wed May 19 21:08:50 EDT 2021

sync with upas mail

--- a/comp.c
+++ b/comp.c
@@ -67,9 +67,6 @@
 	chanfree(c->sync);
 	close(c->fd[0]);
 
-	/* needed because mail is by default Latin-1 */
-	fprint(c->fd[1], "Content-Type: text/plain; charset=\"UTF-8\"\n");
-	fprint(c->fd[1], "Content-Transfer-Encoding: 8bit\n");
 	buf = emalloc(Bufsz);
 	while((n = read(fd, buf, Bufsz)) > 0)
 		if(write(c->fd[1], buf, n) != n)
--- a/mbox.c
+++ b/mbox.c
@@ -175,10 +175,9 @@
 
 	assert(m->parent == nil);
 	for(q = p; q != nil; q = q->parent){
-		if(ideq(m->messageid, q->messageid)){
-			fprint(2, "wonky message replies to self\n");
+		/* some messages refer to themselves */
+		if(ideq(m->messageid, q->messageid))
 			return 0;
-		}
 		if(m->time > q->time)
 			q->time = m->time;
 	}
@@ -715,6 +714,7 @@
 		else
 			mbox.mesg[j++] = m;
 	}
+	mbox.nmesg = j;
 		
 	close(fd);
 	fprint(mbox.ctl, "clean\n");