Skip to content

Commit

Permalink
upas/nfs: fix null date when message is sent to plumber (#263)
Browse files Browse the repository at this point in the history
When fetching, messages are sent to plumber as soon as the ENVELOPE part is read.
    The date field of the message is sent when the INTERNALDATE part is read and
    there is no guarantee that this will be read before the ENVELOPE.
    This bug can be observed when using faces(1) which will retrieve messages with
    a null date and then always display a 'Jan 1' date instead of the correct one.
    The fix is to simply send the message to plumber after having read all parts,
    thus ensuring the message is complete.
  • Loading branch information
telephil authored and dancrossnyc committed Sep 19, 2019
1 parent b9424f6 commit 9389de6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/upas/nfs/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ xfetch(Imap *z, Sx *sx)
if(isatom(sx->sx[i], msgtab[j].name))
msgtab[j].fn(msg, sx->sx[i], sx->sx[i+1]);
}
msgplumb(msg, 0);
}

static void
Expand Down Expand Up @@ -1549,7 +1550,6 @@ xmsgenvelope(Msg *msg, Sx *k, Sx *v)
USED(k);
hdrfree(msg->part[0]->hdr);
msg->part[0]->hdr = parseenvelope(v);
msgplumb(msg, 0);
}

static struct {
Expand Down

0 comments on commit 9389de6

Please sign in to comment.