calendar(1): Refactor mail header composition and sending
authorAaron LI <aly@aaronly.me>
Sun, 10 Nov 2019 02:27:24 +0000 (10:27 +0800)
committerAaron LI <aly@aaronly.me>
Sun, 10 Nov 2019 05:04:32 +0000 (13:04 +0800)
commiteffe59f3df8e35e540b9fcbebe2295138800b16f
treed015e8447220c6517d55577bc77334bd6780c920
parent144b9c45ab6b862b1c9d5fc7dcd6fe0b470a0650
calendar(1): Refactor mail header composition and sending

* Use 'struct iovec header[]' to hold all mail headers, and then use
  writev(2) to write them into the pipe.

* Explicitly set 'LC_TIME=C' when formating the date string for the mail
  header.

Obtained-from: OpenBSD
usr.bin/calendar/calendar.h
usr.bin/calendar/day.c
usr.bin/calendar/io.c