On Sat, 18 Mar 2023 21:12:06 -0400, Gilberto F da Silva
Post by Gilberto F da SilvaMSMTP needs a certificate to be able to send emails but it is
not available in Mageia 9 repositories.
The msmtp is provided as it comes from the author. I use postfix
instead which includes an install scriptlet in the rpm package that
creates the cert.
Before installing postfix, make sure the hostname is a valid dns
name, not localhost or localhost.localdomain.
Once installed modify /etc/postfix/aliases to have your loginid in
place of root where the comment says "# CHANGE THIS LINE to an
account of a HUMAN", then start it's deamon.
You could continue using msmtp, but you'd have to create a cert and
ensure it gets started at boot. It's much easier to just use
postfix instead.
If you want to create a cert, the easiest way would be (after
ensuring the $HOSTNAME is a real dns valid hostname) run
/usr/share/rpm-helper/create-ssl-certificate msmtp 1 msmtp
Starting /usr/bin/msmtpd at boot would require either writing a
systemd config file or creating/modifying an initd script.
ChatGPT provided the solution. It showed me how to get the
certificates with the command:
openssl s_client -connect smtp.gmail.com:465 -showcerts
Once shown the path, I got the certificates for yahoo as well. I
copied parts from:
- -----BEGIN CERTIFICATE-----
MIIFYjCCBEqgAwIBAgIQd70NbNs2+RrqIQ/E8FjTDTANBgkqhkiG9w0BAQsFADBX ...
Until
...
d0lIKO2d1xozclOzgjXPYovJJIultzkMu34qQb9Sz/yilrbCgj8=
- -----END CERTIFICATE-----
in a file with each certificate after the other without leaving any
blank spaces between them. I renamed the file as expected by msmtp and
placed it in the path also expected by msmtp.
- --
Abraços
Gilberto F da Silva