I agree with the need, but not your rationale, I’m in the “always curly braces” camp for two reasons:
- when a second line gets added in a condition block, the braces might not get added, a bug.
- one less decision to make while coding. Anything that removes trivial decision-making can speed up authoring and reading code.
I would recommend email for this. It’s a text-based protocol and the original RFCs 821/822 are pretty straight-forward. There are some additional rabbit holes related to content encoding, but if one can implement a simple MTA, a huge amount of the magic of the internet becomes accessible.
I would not recommend trying to build a “production grade” MTA, as there is a lot of minutia to get right, and it’s easy to screw up.