genkey --days 3650 mail.example.com
oropenssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 365 -x509
Now I actually know a LOT about X.509, having worked on PKIX in IETF. But I am theory, not practice. I want control over CN content and the tutorial with the later shows what I want.