Memory safety helps, but isn't the only source of exploitable bugs.
Re:Small mail server best current practices
by mekster on Tuesday July 28, 2020 @01:13PM
(#23978124)
You would not really want so many "private" ports exposed on a public facing machine.
A machine which has IMAP open tends to look like it has some good stuff.
I just forward incoming emails to an internal SMTP server which also serves as IMAP server, so MX records won't simply reveal your IMAP server as well.
I think that is overkill for self hosting. Also as the author says below, Go is more memory safe than C/C++ in that there is no use after free and buffers are bounds checked.