2018/06/14: Does an email necessarily end in a newline character?

Here, by "email" I mean the syntactical object, not any semantic meaning of mime-encoded files. The answer is "Basically yes." as, when an email is transferred via SMTP, its end is indicated by a line consisting of only a period and there is no quoting to indicate that the last line should be incomplete. However, for local delivery it is much easier for the MTA to implement delivering arbitrary files (e.g., into a maildir(5)), not necessarily ending in a newline character—and, as it turns out, not every email is transferred via SMTP, e.g., if you (or a program on your behalf) send an email to yourself via a sendmail(1)-like interface.

I recently had to learn that when the batching mechanism in my email synchronising solution suddenly broke. Now it terminates every patch it batches with a newline, if it doesn't end in a newline anyway.